-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
API: Index/Series/DataFrame op 1-d list-like coercion #13637
Comments
@sinhrks Nice overview! It are the 'x' that fail?
I agree these should probably all work consistently |
@jorisvandenbossche I meant boolean op with logical op. Though using bool
|
@sinhrks Whoops, yes, |
Found 2 related issues which will be broken if we introduce the above rules: #4576 Pandas 0.12 unexpected results when comparing dataframe to list or tupleon current master: list comparison performed per columns
after the change: list comparison performed performed per row
#11339 Boolean comparison vs tuple fails in 0.17.0on current master: comparison may be broadcasted regarding
after the change: tuple will no longer be regarded as a "single" element. should be the same as
|
@sinhrks I'm trying to figure out what which arithmetic-related Issues are still outstanding, as a lot has been fixed recently. I'm not quite sure how to mark this Issue. Can you help me pin down exactly what this Issue calls for? |
@jbrockmendel I don't catch up recent changes yet. Maybe we should maintain comprehensive ops tests to clarify & guarantee current behaviour. |
@jbrockmendel if you look at the table in the top post, there are still cases ('x') in that table that still don't work. The "Series, Boolean, Index ( But the "Index, Arithmetic, List" and "Index, Arithmetic, Tuple" cases still fail:
|
Looks like the rest of the cases in the table are fixed. Are these tested @jbrockmendel?
|
@jbrockmendel can you confirm that all the cases are fixed / tested? I think things are good, but would be nice to have your input. |
I think these are in good enough shape not to be a blocker, but not in good enough shape to close. Ideally I'd like to work this into something like unpack_zerodim_and_defer to make sure we have a consistent implementation |
Closing as addressed. |
xref #1134. There is another inconsistencies related to op.
Index/Series/DataFrame
op can accept 1-d list-like as input and coercing toIndex/Series
. However, supported 1-d list-likes differ depending on the class and kind of op.Code Sample, a copy-pastable example if possible
I've organize the result once as the below table. I think all these must be supported and consistent.
NOTE: Index result may depends on its type.
output of
pd.show_versions()
0.18.1
The text was updated successfully, but these errors were encountered: