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

Let DataFrame behave more like GroupedDataFrame with one zero-key group #3257

Closed
jariji opened this issue Dec 27, 2022 · 1 comment
Closed
Labels
Milestone

Comments

@jariji
Copy link
Contributor

jariji commented Dec 27, 2022

df::DataFrame is conceptually similar to groupby(df, []), so keys(df) could work but currently throws a MethodError. This change would simplify the mental model of using these objects.

@jariji jariji changed the title Let DataFrame behave more like GroupedDataFrame with one group Let DataFrame behave more like GroupedDataFrame with one zero-key group Dec 27, 2022
@bkamins bkamins added this to the 1.5 milestone Dec 27, 2022
@bkamins
Copy link
Member

bkamins commented Dec 27, 2022

We cannot do it.

The contract for keys is:

  keys(iterator)

  For an iterator or collection that has keys and values (e.g. arrays and dictionaries), return an iterator over the
  keys.

AbstractDataFrame is not an iterator (as opposed to GroupedDataFrame). Also I do not think we want to make it an iterator with a single (or no) groups.

I initially was open to discuss it, but it seems to me that it is almost impossible that we will change this decision (people would be confused if we made AbstractDataFrame iterable this way), so I am closing the issue. But maybe @nalimilan will have another opinion.

@bkamins bkamins closed this as completed Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants