-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Performance improvements for nunique method. #7784
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
Changes from all commits
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 |
---|---|---|
|
@@ -215,6 +215,16 @@ def is_(self, other): | |
# use something other than None to be clearer | ||
return self._id is getattr(other, '_id', Ellipsis) | ||
|
||
def dropna(self): | ||
""" | ||
Return Index without null values | ||
|
||
Returns | ||
------- | ||
dropped : Index | ||
""" | ||
return self[~isnull(self.values)] | ||
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. should just be 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. tests fail with that change:
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 ok going to need a test for each index type for dropna (except Int64) of course |
||
|
||
def _reset_identity(self): | ||
"""Initializes or resets ``_id`` attribute with new object""" | ||
self._id = _Identity() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
'plotting', | ||
'reindex', | ||
'replace', | ||
'series_methods', | ||
'sparse', | ||
'strings', | ||
'reshape', | ||
|
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.
I bet it hits the AttributeError every time.
values
are numpy arrays here, you have to doself.dropna()