-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Add regression test for Series index.map failing (#20990) #29093
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
@WillAyd ping |
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.
Minor comment otherwise lgtm
# see GH20990 | ||
count = 6 | ||
index = pd.date_range("2018-01-01", periods=count, freq="M", name=name) | ||
a = pd.Series(np.arange(count), index=index) |
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 delete the Series altogether and just use tm.assert_index_equal
? I don't think the Series is required at all
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.
Do you mean to make it look like following?
@pytest.mark.parametrize("name", [None, "name"])
def test_index_map(self, name):
# see GH20990
count = 6
index = pd.date_range("2018-01-01", periods=count, freq="M", name=name).map(lambda x: (x.year, x.month))
expected = pd.MultiIndex.from_product(
((2018,), range(1, 7)), names=[name, name]
)
tm.assert_index_equal(index, 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.
@WillAyd ping
pls merge master |
Thanks @Reksbril ! |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff