Skip to content

Mix EA into DTA/TDA; part of 24024 #24502

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

Merged
merged 4 commits into from
Dec 30, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
re-implement map
  • Loading branch information
jbrockmendel committed Dec 30, 2018
commit 27de4b0bdfb37c9262d9cb11021f565b401d7fc8
10 changes: 10 additions & 0 deletions pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,16 @@ def value_counts(self, dropna=False):
name=result.index.name)
return Series(result.values, index=index, name=result.name)

def map(self, mapper):
# TODO(GH-23179): Add ExtensionArray.map
# Need to figure out if we want ExtensionArray.map first.
# If so, then we can refactor IndexOpsMixin._map_values to
# a standalone function and call from here..
# Else, just rewrite _map_infer_values to do the right thing.
from pandas import Index

return Index(self).map(mapper).array

# ------------------------------------------------------------------
# Null Handling

Expand Down