-
Notifications
You must be signed in to change notification settings - Fork 370
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
Allow DataFrame(matrix, names, copycols=false) #2860
Comments
I am not sure we want it. I would rather fix the documentation that we do not allow it. The reason is that What is your use case? @nalimilan - do you have any opinion here? |
Interesting corner case! I'd say that we could allow |
Agreed - that is why I asked for the use case. Again - most users find the behavior of DataFrames.jl confusing if the columns are |
I find the views reasonable since the user is basically asking for them by writing My use case: I was loading data from "large" Excel files (1 million rows). The column names are actually on the 4th row, and some columns must be discarded, so I get the actual data using |
Here is the crucial point of the question. Why do you want to avoid copying (apart from the fact that "you can"). Is there some reason to do it (the only I can see is to save memory, as copying should be fast). |
Indeed it was to save memory: some notebooks get very memory intensive as memory won't be reclaimed from temporary variables unless they're manually reassigned, and mybinder.org instances for example are only 1-2 GB... |
OK - I think we can have this change. I will add it to #2859 |
Added in #2859. Can you please test? |
@bkamins sorry for the delay, I confirm it's now working for me on the main branch. Thanks! |
The documentation suggests that e.g.
DataFrame(rand(2,2), [:a, :b], copycols=false)
should be supported:DataFrames.jl/src/dataframe/dataframe.jl
Lines 16 to 18 in 0a736de
but it fails with
got unsupported keyword argument "copycols"
.It would be nice to have this as a simpler version of
The text was updated successfully, but these errors were encountered: