-
Notifications
You must be signed in to change notification settings - Fork 368
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
Usage of eachcol
seems to be a pun?
#2636
Comments
There are two issues here:
I think this is clearly a bug. This is currently an I am fully in agreement to change it.
This is a harder thing. In DataFrames.jl 0.21 Now In summary:
But of course I am open to hear other opinions as the decision here is hard. CC @nalimilan |
Excellent. I suspect that was originally implemented back when
As it's not an (Of course - if |
I've commented on the TypedTables issue, but in short, there's no bug/issue w/ the Tables.jl implementation. Specifically, |
@quinnj - you are right. This is not a bug - it was late yesterday, and I read the docstring of Still we could consider defining:
Do you think there would be a benefit of doing this (the downside is that it would be a breaking change, but I assume people do not use |
For the history, DataFrames defined
This came up before at #2244. I think we can consider that the type of object we return from |
Do we go this way? If we were to make this change I would prefer to have it included in 1.0 release. CC @quinnj |
That sounds good to me. |
I'm opening this in response to JuliaData/TypedTables.jl#68, with the hope of improving consistency across the ecosystem.
It seems that DataFrames.jl overloads
Base.eachcol
to return the column interatorDataFrameColumns
. To me, this seems like a bit of a pun, and thecolumns
function fromTables.jl
seems to be a much better fit for this behavior.While this seems harmless at first, tables (in the Tables.jl sense) like
Matrix{NamedTuple}
or aTypedTables.Table <: AbstractMatrix
are required to followBase
behavior. I seeBase.eachcol
as anAbstractArray
interface - and one that is actively being built upon inBase
(soon it will return a lazy vector-of-vectorsSliceArray
rather than just an iterator - see JuliaLang/julia#32310).This leaves the data table ecosystem a little bit split. Even ignoring TypedTables, users may first learn to use a
CSV.File
and aVector{<:NamedTuple}
and will need to usecolumns
there and switch toeachcol
later when they learn DataFrames.jl. Do you think it would be reasonable to use the Tables.jl interfacecolumns
to return aDataFrameColumns
instead?The text was updated successfully, but these errors were encountered: