@@ -744,44 +744,6 @@ def map(self, mapper):
744
744
745
745
return Index (self ).map (mapper ).array
746
746
747
- def value_counts (self , dropna = False ):
748
- """
749
- Return a Series containing counts of unique values.
750
-
751
- Parameters
752
- ----------
753
- dropna : boolean, default True
754
- Don't include counts of NaT values.
755
-
756
- Returns
757
- -------
758
- Series
759
- """
760
- # n.b. moved from PeriodArray.value_counts
761
- from pandas import Series , Index
762
-
763
- if dropna :
764
- values = self [~ self .isna ()]._data
765
- else :
766
- values = self ._data
767
-
768
- cls = type (self )
769
-
770
- result = value_counts (values , sort = False , dropna = dropna )
771
- index = Index (cls (result .index , dtype = self .dtype ),
772
- name = result .index .name )
773
- return Series (result .values , index = index , name = result .name )
774
-
775
- def map (self , mapper ):
776
- # TODO(GH-23179): Add ExtensionArray.map
777
- # Need to figure out if we want ExtensionArray.map first.
778
- # If so, then we can refactor IndexOpsMixin._map_values to
779
- # a standalone function and call from here..
780
- # Else, just rewrite _map_infer_values to do the right thing.
781
- from pandas import Index
782
-
783
- return Index (self ).map (mapper ).array
784
-
785
747
# ------------------------------------------------------------------
786
748
# Null Handling
787
749
0 commit comments