@@ -181,7 +181,6 @@ def _from_factorized(cls, values, original):
181
181
# ------------------------------------------------------------------------
182
182
183
183
def __getitem__ (self , item ):
184
- # type (Any) -> Any
185
184
"""
186
185
Select a subset of self.
187
186
@@ -213,7 +212,6 @@ def __getitem__(self, item):
213
212
raise AbstractMethodError (self )
214
213
215
214
def __setitem__ (self , key , value ):
216
- # type: (Union[int, np.ndarray], Any) -> None
217
215
"""
218
216
Set one or more values inplace.
219
217
@@ -261,7 +259,6 @@ def __setitem__(self, key, value):
261
259
)
262
260
263
261
def __len__ (self ):
264
- # type: () -> int
265
262
"""
266
263
Length of this array
267
264
@@ -286,31 +283,27 @@ def __iter__(self):
286
283
# ------------------------------------------------------------------------
287
284
@property
288
285
def dtype (self ):
289
- # type: () -> ExtensionDtype
290
286
"""
291
287
An instance of 'ExtensionDtype'.
292
288
"""
293
289
raise AbstractMethodError (self )
294
290
295
291
@property
296
292
def shape (self ):
297
- # type: () -> Tuple[int, ...]
298
293
"""
299
294
Return a tuple of the array dimensions.
300
295
"""
301
296
return (len (self ),)
302
297
303
298
@property
304
299
def ndim (self ):
305
- # type: () -> int
306
300
"""
307
301
Extension Arrays are only allowed to be 1-dimensional.
308
302
"""
309
303
return 1
310
304
311
305
@property
312
306
def nbytes (self ):
313
- # type: () -> int
314
307
"""
315
308
The number of bytes needed to store this object in memory.
316
309
"""
@@ -342,7 +335,6 @@ def astype(self, dtype, copy=True):
342
335
return np .array (self , dtype = dtype , copy = copy )
343
336
344
337
def isna (self ):
345
- # type: () -> Union[ExtensionArray, np.ndarray]
346
338
"""
347
339
A 1-D array indicating if each value is missing.
348
340
@@ -365,7 +357,6 @@ def isna(self):
365
357
raise AbstractMethodError (self )
366
358
367
359
def _values_for_argsort (self ):
368
- # type: () -> ndarray
369
360
"""
370
361
Return values for sorting.
371
362
@@ -597,7 +588,6 @@ def searchsorted(self, value, side="left", sorter=None):
597
588
return arr .searchsorted (value , side = side , sorter = sorter )
598
589
599
590
def _values_for_factorize (self ):
600
- # type: () -> Tuple[ndarray, Any]
601
591
"""
602
592
Return an array and missing value suitable for factorization.
603
593
@@ -622,7 +612,6 @@ def _values_for_factorize(self):
622
612
return self .astype (object ), np .nan
623
613
624
614
def factorize (self , na_sentinel = - 1 ):
625
- # type: (int) -> Tuple[ndarray, ExtensionArray]
626
615
"""
627
616
Encode the extension array as an enumerated type.
628
617
@@ -725,7 +714,6 @@ def repeat(self, repeats, axis=None):
725
714
# ------------------------------------------------------------------------
726
715
727
716
def take (self , indices , allow_fill = False , fill_value = None ):
728
- # type: (Sequence[int], bool, Optional[Any]) -> ExtensionArray
729
717
"""
730
718
Take elements from an array.
731
719
@@ -815,7 +803,6 @@ def take(self, indices, allow_fill=False, fill_value=None):
815
803
raise AbstractMethodError (self )
816
804
817
805
def copy (self , deep = False ):
818
- # type: (bool) -> ExtensionArray
819
806
"""
820
807
Return a copy of the array.
821
808
@@ -852,7 +839,6 @@ def __repr__(self):
852
839
dtype = self .dtype )
853
840
854
841
def _formatter (self , boxed = False ):
855
- # type: (bool) -> Callable[[Any], Optional[str]]
856
842
"""Formatting function for scalar values.
857
843
858
844
This is used in the default '__repr__'. The returned formatting
@@ -880,7 +866,6 @@ def _formatter(self, boxed=False):
880
866
return repr
881
867
882
868
def _formatting_values (self ):
883
- # type: () -> np.ndarray
884
869
# At the moment, this has to be an array since we use result.dtype
885
870
"""
886
871
An array of values to be printed in, e.g. the Series repr
@@ -897,7 +882,6 @@ def _formatting_values(self):
897
882
898
883
@classmethod
899
884
def _concat_same_type (cls , to_concat ):
900
- # type: (Sequence[ExtensionArray]) -> ExtensionArray
901
885
"""
902
886
Concatenate multiple array
903
887
@@ -920,7 +904,6 @@ def _concat_same_type(cls, to_concat):
920
904
921
905
@property
922
906
def _ndarray_values (self ):
923
- # type: () -> np.ndarray
924
907
"""
925
908
Internal pandas method for lossy conversion to a NumPy ndarray.
926
909
0 commit comments