I might have missed this but why is `head(df::AbstractDataFrame)` deprecated?

FWIW, I think that

  1. first is a bad pun here: DataFrames per se are not iterable (one has to go through the Tables.jl interface to get a row iterator),

  2. it is not really a good idea to combine the extraction of the first row (a DataFrameRow) and the first n rows (a DataFrame) in a single interface function; that’s like a function sometimes returning a matrix, sometimes a vector,

  3. one should not necessarily introduce a function for either of these, but think about the purpose: the user usually just wants a preview of the dataframe without looking at the whole thing; so just make Base.show print the first and last 10-10 rows or so (currently I think it is 20-20). For the rest, there are the shiny new Base.getindex accessors.

That said, I think these things are the decision of the package maintainers, and the best place to discuss them is in issues. It is great to solicit input from users, but interfaces need a single architect, or possibly a small team of 2-3 individuals, but not more.

13 Likes