-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Series.at returning Series with one element instead of scalar #38101
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
pandas/tests/indexing/test_scalar.py
Outdated
@@ -300,3 +300,10 @@ def test_multiindex_at_set(): | |||
assert series.at[1, 3] == 5 | |||
series.loc[1, 3] = 6 | |||
assert series.loc[1, 3] == 6 | |||
|
|||
|
|||
def test_at_get_multiindex_one_level(): |
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 rename to
test_multiindex_at_get_one_level
do we have similar tests? can you co-locate
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.
In the same file above and test_at. One in test_partial, but this one is checking different things
Renamed the test
hmm, lots of things are failing, can you merge master and ping on green. |
Good test, caught a bug. Adjusted the code. |
@jreback green now |
thanks @phofl |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
I think if we are at this place and len(values) is 1, we want to return a scalar instead of a Series. This happens only because loc is a slice (0,1) with one MultiIndex level instead of a scalar.
Should I create a file to move all MultiIndex at tests to the MultiIndex folder?