@@ -57,7 +57,7 @@ class DatetimeIndexOpsMixin(ExtensionOpsMixin):
57
57
"""
58
58
common ops mixin to support a unified interface datetimelike Index
59
59
"""
60
- _data = None # type: DatetimeLikeArrayMixin
60
+ _data = None
61
61
62
62
# DatetimeLikeArrayMixin assumes subclasses are mutable, so these are
63
63
# properties there. They can be made into cache_readonly for Index
@@ -220,9 +220,9 @@ def __contains__(self, key):
220
220
221
221
# Try to run function on index first, and then on elements of index
222
222
# Especially important for group-by functionality
223
- def map (self , f ):
223
+ def map (self , mapper , na_action = None ):
224
224
try :
225
- result = f (self )
225
+ result = mapper (self )
226
226
227
227
# Try to use this result if we can
228
228
if isinstance (result , np .ndarray ):
@@ -232,7 +232,7 @@ def map(self, f):
232
232
raise TypeError ('The map function must return an Index object' )
233
233
return result
234
234
except Exception :
235
- return self .astype (object ).map (f )
235
+ return self .astype (object ).map (mapper )
236
236
237
237
def sort_values (self , return_indexer = False , ascending = True ):
238
238
"""
@@ -430,8 +430,8 @@ def argmax(self, axis=None, skipna=True, *args, **kwargs):
430
430
# --------------------------------------------------------------------
431
431
# Rendering Methods
432
432
433
- def _format_with_header (self , header , ** kwargs ):
434
- return header + list (self ._format_native_types (** kwargs ))
433
+ def _format_with_header (self , header , na_rep = 'NaT' , ** kwargs ):
434
+ return header + list (self ._format_native_types (na_rep , ** kwargs ))
435
435
436
436
@property
437
437
def _formatter_func (self ):
@@ -509,7 +509,7 @@ def __rsub__(self, other):
509
509
510
510
cls .__rsub__ = __rsub__
511
511
512
- def isin (self , values ):
512
+ def isin (self , values , level = None ):
513
513
"""
514
514
Compute boolean array of whether each index value is found in the
515
515
passed set of values.
0 commit comments