-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
loc
for Series with a MultiIndex (#7243)
Fixes #7221 and adds improvements to `loc` with a MultiIndex. * Previously, `loc` on a `Series` with a `MultiIndex` would fail. For example: ```python In [7]: sr Out[7]: n_workers type 1 fit 1 2 load 2 3 predict 3 Name: x, dtype: int64 In [8]: sr.loc[(1, "fit")] # KeyError ```` * Previously, `loc` on a `DataFrame` with a `MultiIndex` would fail when a slice without `start` or `end` was used. For example: ```python In [3]: df Out[3]: x n_workers type 1 fit 1 2 load 2 3 predict 3 In [4]: df.loc[:(2, "load")] # TypeError ``` Both the above issues have been addressed and tests added. Authors: - Ashwin Srinath (@shwina) Approvers: - Keith Kraus (@kkraus14) - Michael Wang (@isVoid) - GALI PREM SAGAR (@galipremsagar) - Ram (Ramakrishna Prabhu) (@rgsl888prabhu) URL: #7243
- Loading branch information
Showing
5 changed files
with
108 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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