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

Incorrect DataFrame example in docstring #1103

Closed
skylarbpayne opened this issue Oct 13, 2016 · 1 comment
Closed

Incorrect DataFrame example in docstring #1103

skylarbpayne opened this issue Oct 13, 2016 · 1 comment

Comments

@skylarbpayne
Copy link

The comment in line 51 of https://github.com/JuliaStats/DataFrames.jl/blob/master/src/dataframe/dataframe.jl is incorrect. It fails with the following error:

julia> v = ["x","y","z"][rand(1:3, 10)]
10-element Array{String,1}:
 "x"
 "x"
 "x"
 "z"
 "y"
 "z"
 "y"
 "z"
 "x"
 "x"

julia> df1 = DataFrame(Any[[1:10], v, rand(10)], [:A, :B, :C])
ERROR: ArgumentError: All columns in a DataFrame must be the same length
 in DataFrames.DataFrame(::Array{Any,1}, ::DataFrames.Index) at /home/skpayne/.julia/v0.5/DataFrames/src/dataframe/dataframe.jl:86
 in DataFrames.DataFrame(::Array{Any,1}, ::Array{Symbol,1}) at /home/skpayne/.julia/v0.5/DataFrames/src/dataframe/dataframe.jl:107
@nalimilan
Copy link
Member

Actually, the problem comes from a change in Julia's concatenation behavior. The new syntax is DataFrame(Any[collect(1:10), v, rand(10)], [:A, :B, :C]).

femtotrader added a commit to femtotrader/DataFrames.jl that referenced this issue Oct 16, 2016
nalimilan pushed a commit that referenced this issue Oct 16, 2016
nalimilan pushed a commit that referenced this issue Jul 8, 2017
nalimilan pushed a commit that referenced this issue Jul 8, 2017
rofinn pushed a commit that referenced this issue Aug 17, 2017
nalimilan pushed a commit that referenced this issue Aug 25, 2017
quinnj pushed a commit that referenced this issue Sep 2, 2017
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

2 participants