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

Follow Julia 1.7 broadcasting rules #2643

Closed
bkamins opened this issue Mar 5, 2021 · 3 comments · Fixed by #2645
Closed

Follow Julia 1.7 broadcasting rules #2643

bkamins opened this issue Mar 5, 2021 · 3 comments · Fixed by #2645
Milestone

Comments

@bkamins
Copy link
Member

bkamins commented Mar 5, 2021

see JuliaLang/julia#39859

We have to decide what to do with:

julia> df = DataFrame(a=1:3)
3×1 DataFrame
 Row │ a     
     │ Int64 
─────┼───────
   1 │     1
   2 │     2
   3 │     3

julia> x = zeros(3)
3-element Vector{Float64}:
 0.0
 0.0
 0.0

julia> x .= df
3-element Vector{Float64}:
 1.0
 2.0
 3.0

julia> df[!, 1] .= df
ERROR: DimensionMismatch("cannot broadcast a data frame into 1 dimensions")
@bkamins
Copy link
Member Author

bkamins commented Mar 5, 2021

@nalimilan - do you think we should only fix the tests or allow df[!, 1] .= df if df has one column?

@nalimilan
Copy link
Member

I'd keep throwing an error. I don't see a strong reason this pattern would be useful, and as you noted at JuliaLang/julia#39859 we are a bit stricter than arrays since data frames are always 2D.

@bkamins
Copy link
Member Author

bkamins commented Mar 5, 2021

OK - so I will just fix tests.

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

Successfully merging a pull request may close this issue.

2 participants