Skip to content

getindex/setindex for multi-dimensional DataArrays #440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mkriele opened this issue Dec 9, 2013 · 3 comments
Closed

getindex/setindex for multi-dimensional DataArrays #440

mkriele opened this issue Dec 9, 2013 · 3 comments

Comments

@mkriele
Copy link

mkriele commented Dec 9, 2013

While I can access 2-dimensional DataArrays using the []-notation, it seems to fail for higher-dimensional DataArrays:

julia> dm = DataArray(Float64,2,3,2)
2x3x2 DataArray{Float64,3}:
[:, :, 1] =
 NA  NA  NA
 NA  NA  NA

[:, :, 2] =
 NA  NA  NA
 NA  NA  NA

julia> dm[1,2,2]
ERROR: no method getindex(DataArray{Float64,3},Int64,Int64,Int64)

julia> dm[1,2,2]=1.0
ERROR: no method setindex!(DataArray{Float64,3},Float64,Int64,Int64,Int64)

I am using the version of DataFrames which was bundled with the Julia binary 0.2.0 for mac.
Is there are work-around for this issue?
Thanks, Marcus

@felixjung
Copy link

Having the same issue on my end using version 0.2.1 on a Mac installed via home-brew.

@simonster
Copy link
Contributor

Fixed by JuliaStats/DataArrays.jl#104 (although you'll need Julia 0.3 to get the fix)

@felixjung
Copy link

Sweet! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants