Skip to content
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

readcsv results in array dimension error #6247

Closed
XilinJia opened this issue Mar 24, 2014 · 3 comments
Closed

readcsv results in array dimension error #6247

XilinJia opened this issue Mar 24, 2014 · 3 comments

Comments

@XilinJia
Copy link

julia> blob2 = readcsv("Data/17.csv")
576x3 Array{Any,2}:
"" "" ""
1.1002e6 1728.0 1728.0
1.10021e6 -2424.0 -696.0
1.10021e6 -246.0 -942.0

1.13122e6 328.0 80938.0
1.13123e6 1288.0 82226.0
1.13123e6 -372.0 81854.0
#undef #undef #undef

julia> length(blob2[2:end, 1])
ERROR: access to undefined reference
in _getindex! at multidimensional.jl:32
in getindex at multidimensional.jl:45

julia> blob2
576x3 Array{Any,2}:
"" "" ""
1.1002e6 1728.0 1728.0
1.10021e6 -2424.0 -696.0
1.10021e6 -246.0 -942.0

1.13122e6 328.0 80938.0
1.13123e6 1288.0 82226.0
1.13123e6 -372.0 81854.0
#undef #undef #undef

julia> endof(blob2)
1728

julia> endof(blob2[:,1])
ERROR: access to undefined reference
in _getindex! at multidimensional.jl:32
in getindex at multidimensional.jl:45

@tkelman
Copy link
Contributor

tkelman commented Mar 24, 2014

What's on the last line of Data/17.csv?

@quinnj
Copy link
Member

quinnj commented Mar 24, 2014

Yeah, it looks like you may have an empty newline at the end of the file.
readdlm should probably be smarter though.

On Sun, Mar 23, 2014 at 8:39 PM, Tony Kelman [email protected]:

What's on the last line of Data/17.csv?

Reply to this email directly or view it on GitHubhttps://github.com//issues/6247#issuecomment-38403563
.

@XilinJia
Copy link
Author

yes, there is a newline at the end of the file

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