-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
TST: new test for subset of a MultiIndex dtype #29356
TST: new test for subset of a MultiIndex dtype #29356
Conversation
pandas/tests/test_multilevel.py
Outdated
False, | ||
0, | ||
0, | ||
False, |
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.
can you make this a bit more programatic, rather than hardcoding these values, it would be easier to copy-paste
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 the feedback, @jreback! Reproduced the same behaviour with simpler input data.
pandas/tests/test_multilevel.py
Outdated
columns = pd.MultiIndex.from_tuples(columns) | ||
df = pd.DataFrame(data, columns=columns) | ||
|
||
tm.assert_equal(df.dtypes.a.d.i, df.a.d.i.dtypes) |
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.
can you use
result=
expected=
tm.assert_frame_equal(result, equal)
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 the feedback, @jreback! Currently using tm.assert_series_equal(result, expected)
.
dff9cab
to
d71f8ac
Compare
66742a6
to
7ea396e
Compare
thanks @ganevgv |
Tried unsuccessfully reproducing Issue #20757 on pandas: 0.23.0 and 0.26.0.dev0+734.g0de99558b.dirty. That's why I decided to keep the input data from Issue #20757 unchanged.
MultiIndex
DataFrame
sometimes changesdtypes
#20757black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff