-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: flex op with DataFrame, Series and ea vs ndarray #34277
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
baf4e38
test for axis=1 case
jbrockmendel ea3aaba
GH ref
jbrockmendel 4ef99a7
Merge branch 'master' of https://github.com/pandas-dev/pandas into bu…
jbrockmendel 612fab6
REF: send broadcastable Series through DataFrame route
jbrockmendel c59650c
Merge branch 'master' of https://github.com/pandas-dev/pandas into bu…
jbrockmendel b857721
REF: re-use DataFrame dispatch code
jbrockmendel ddb9fa3
typo fixup
jbrockmendel 5c85d1a
Merge branch 'master' of https://github.com/pandas-dev/pandas into bu…
jbrockmendel 86eaed9
port test from #34312
jbrockmendel a99028e
revert whatsnew
jbrockmendel 95442be
Merge branch 'master' of https://github.com/pandas-dev/pandas into bu…
jbrockmendel 1c36218
Merge branch 'master' of https://github.com/pandas-dev/pandas into bu…
jbrockmendel 19d8c7d
Merge branch 'master' of https://github.com/pandas-dev/pandas into bu…
jbrockmendel e9ca4c2
Merge branch 'master' of https://github.com/pandas-dev/pandas into bu…
jbrockmendel ee17990
rename
jbrockmendel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to turn this into a DataFrame?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative is to re-implement the ensure-shape-shape-values code in ops.blockwise (see the first commit, which did it that way)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it need to be the same shape? The block op or array op should be able to handle this broadcasting automatically themselves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ndarray handles broadcasting, but DTA/TDA dont. I checked with seberg a few months ago who said there isnt a perf penalty to operating on the broadcasted ndarray.
ive got plans to make it so we dont need to wrap the ndarray in a DataFrame (which we actually do in _align_method_FRAME too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the "hidden" 2D version of DTA/TDA? (EAs in general handle broadcasting)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im not sure thats accurate in general (in particular the
op(ea_len_1, arr_len_n)
), but that can be discussed separatelyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, indeed, that's a broadcasting that will not be generally supported (we probably should though, worth to open an issue about that).
Now, I was thinking about the
op(frame_with_EA_column, array_len_n)
case, where the array is aligned on the columns of the frame. Which means that each EA (1 column) gets a scalar, I think (op(EA, scalar)
?Or, we might want to change this to an array of len 1 in case the scalar loses information? (which can be the case where the 1D array-like is an EA / Series[EA] instead of a numpy array)