-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: GH26650, added new test to validate numpy matmul function with dataframes #47427
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
Conversation
carbonleakage
commented
Jun 20, 2022
- closes Handle numpy.matmul in DataFrame.__array_ufunc__ #26650
- [Tests added and passed]
- All [code checks passed]
Please let the reviewer resolve the conversations |
pandas/tests/series/test_ufunc.py
Outdated
# GH26650 | ||
data = [-1, 1, 10] | ||
df = pd.DataFrame({"nums": data}) | ||
dfT = df.T |
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.
Please avoid these functions
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.
Thanks for reviewing and the feedback. I removed these lines and declared everything directly on the assert statement. Just for my understanding, these lines needed to be removed since they introduce too many variables?
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.
No, we try to define tests in a way that they do not rely on functions that are not tested itself. E.g. .T was not necessary to reproduce the behavior.
You can do it like:
df=...
result=...
expected=...
arm.assert_frame_equal(result, expected)
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.
Oh ok, I see. Thanks again! I modified the PR to reflect this.
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.
lgtm
Thanks @carbonleakage |
Thanks @mroeschke and @phofl! |
…ataframes (pandas-dev#47427) * TST: GH26650, added new test to validate numpy matmul function with dataframes as inputs * TST: GH26650, updated variable names * Updated based on PR feedback * Removed variable initialisations per feedback * Final updates to PR * Update pandas/tests/series/test_ufunc.py Co-authored-by: Matthew Roeschke <[email protected]>