-
Notifications
You must be signed in to change notification settings - Fork 21
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
What methods does Column have? #107
Comments
Hasn't been done yet. Its worth noting the df interchange protocol specifies columns used in interchange (say |
Not quite. From gh-50, which is quite relevant here: We had (/have) a pretty strong consensus that there should not be a separate Series-like object, but only a DataFrame object with a single column. IIRC the key issue is that Series and DataFrame have so much API duplication, for little benefit. And that statement goes all the way back to gh-6, which contains a lot of the early discussion. The duplication pandas & co have with essentially duplicate APIs on the dataframe and series objects seemed undesirable to most folks. That said, when actually implementing the interchange protocol we figured out that it's not 100% practical to not have a |
While those older github issues indeed discussed to not have a separate 1D / column object, I seem to remember that on one of the more recent meetings where we discussed this, we landed on the opposite conclusion? |
Is it enough to return a 1-column dataframe? Say someone has the following (very common) pattern in pandas: In [33]: df = pd.DataFrame({'a': [1,2,3], 'b': [4,5,6]})
In [34]: mask = df['a'] > 1
In [35]: df.loc[mask, ]
Out[35]:
a b
1 2 5
2 3 6 How could this be written with the standard? If df_standard = dataframe_standard(df)
mask = df.get_column_by_name('a') > 1
df_standard.get_rows_by_mask(mask) Without a |
Right, indeed - thank you for finding that discussion. I think we need to update gh-50 with a clear summary of that. The tl;dr would be "so column is array-like and then has special behavior for missing values in reductions (with uniform |
This is done now. I believe this particular is resolved, since we have a good collection of methods on |
Currently, nothing is defined
dataframe-api/spec/API_specification/dataframe_api/column_object.py
Lines 1 to 2 in 9673b35
Just for my understanding, is this because it hasn't been done yet, or because it would be the same as from the Protocol?
https://github.com/data-apis/dataframe-api/blob/main/protocol/dataframe_protocol.py
The text was updated successfully, but these errors were encountered: