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

columns, rows & slices views #32317

Open
StefanKarpinski opened this issue Jun 13, 2019 · 4 comments
Open

columns, rows & slices views #32317

StefanKarpinski opened this issue Jun 13, 2019 · 4 comments
Labels
arrays [a, r, r, a, y, s] speculative Whether the change will be implemented is speculative

Comments

@StefanKarpinski
Copy link
Sponsor Member

#32310 made me think of a discussion I'd had about data frames and wanting to be able to write columns(df) to access a data frame as a collection of columns. We could make eachcol(df) work like that but the each in the name gets a bit weird. So perhaps we might want to rename (or alias until 2.0) eachcol to columns and make it act more like a view of the underlying collection than as just an iterator. There would be corresponding rows and slices view wrappers. Thoughts?

@StefanKarpinski StefanKarpinski added speculative Whether the change will be implemented is speculative arrays [a, r, r, a, y, s] labels Jun 13, 2019
@StefanKarpinski StefanKarpinski modified the milestones: 2.0, 1.x Jun 13, 2019
@bkamins
Copy link
Member

bkamins commented Jun 14, 2019

In DataFrames.jl eachcol and eachrow already produce AbstractArray objects. eachcol and eachrow were simply legacy names (and consistent with Base).

Therefore, at least from DataFrames.jl perspective it is not a problem if in Base the following decision were made:

  • start using columns and rows as target function names and define const eachcol = columns and const eachrow = rows temporarily;
  • in some future time drop eachrow and eachcol aliases

@nalimilan
Copy link
Member

Indeed the "each" prefix sounds a bit off when the function returns (or could return) an AbstractVector, so +1 to switching to rows, columns and slices.

@StefanKarpinski
Copy link
Sponsor Member Author

StefanKarpinski commented Jun 14, 2019

The approach would be to make rows, columns and slices the primary names and leave the each* versions around but document them as being deprecated and then actually deprecate them in 2.0.

@AzamatB
Copy link
Contributor

AzamatB commented Jun 14, 2019

+1 for this change. Although this was originally discussed in #14491 (comment), where it was decided against rows, columns, slices and in favor of each*.

@DilumAluthge DilumAluthge removed this from the 1.x milestone Mar 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s] speculative Whether the change will be implemented is speculative
Projects
None yet
Development

No branches or pull requests

5 participants