-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix multiindex loc nan #43943
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
Fix multiindex loc nan #43943
Changes from all commits
549386c
81970c7
8443c62
9eae773
c497e34
fde027b
0ef5d04
246a421
bbeeb1b
6b38ba4
d04b7b8
cc75b44
c88b2d8
0a3ce38
ed537cc
77e7283
72fb026
cf0355d
427a515
29c37b6
d274bca
f72cbf7
7ab0c9c
a758d44
c3ec7f0
245b141
ae706c8
30097ca
ef951a6
0fa1784
1f78023
5b3c61d
98c8f13
ec218d5
d92cc60
4dda020
6850b73
e7a52e3
9682350
0ad2583
cb92f95
e3c734d
cf48e70
49b1d65
d00b39f
a97ef1a
d180901
cc6af9d
02bf699
7211984
4520444
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -869,7 +869,16 @@ def ngroups(self) -> int: | |
def reconstructed_codes(self) -> list[np.ndarray]: | ||
codes = self.codes | ||
ids, obs_ids, _ = self.group_info | ||
return decons_obs_group_ids(ids, obs_ids, self.shape, codes, xnull=True) | ||
# get the levels in which to reconstruct codes for na | ||
levels_with_na = [ | ||
idx | ||
for idx, grouping in enumerate(self.groupings) | ||
if grouping._has_na_placeholder | ||
] | ||
reconstructed_codes = decons_obs_group_ids( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. umm would be better to actually do this in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i dunno, not wild about core.sorting needing to know anything about self._groupings There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm i take this back, this now makes sorting dependent on groupby.ops which is very strange. @CloseChoice so instead am ok to pass something do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed this to pass only a list where we need to reconstruct the codes for na |
||
ids, obs_ids, self.shape, codes, xnull=True, levels_with_na=levels_with_na | ||
) | ||
return reconstructed_codes | ||
|
||
@final | ||
@cache_readonly | ||
|
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.
if you can move to 1.5