@@ -355,6 +355,12 @@ def __len__(self):
355355 def __getitem__ (self , item ):
356356 err_msg = ("Only integers, slices and integer or boolean"
357357 "arrays are valid indices." )
358+ if isinstance (item , tuple ) and len (item ) == 2 :
359+ if item [0 ] is Ellipsis :
360+ item = item [1 ]
361+ elif item [1 ] is Ellipsis :
362+ item = item [0 ]
363+
358364 if isinstance (item , Integral ):
359365 item = int (item )
360366 if item < - len (self ) or item >= len (self ):
@@ -390,7 +396,7 @@ def __getitem__(self, item):
390396 # Check mask length is compatible
391397 if len (item ) != len (self ):
392398 raise IndexError (
393- "boolean mask length ({}) doesn't match array length ({}) "
399+ "Boolean index has wrong length: {} instead of {} "
394400 .format (len (item ), len (self ))
395401 )
396402
@@ -423,7 +429,7 @@ def take(self, indices, allow_fill=False, fill_value=None):
423429 # Validate self non-empty (Pandas expects this error when array is empty)
424430 if (len (self ) == 0 and len (indices ) > 0 and
425431 (not allow_fill or any (indices >= 0 ))):
426- raise IndexError ("cannot do a non-empty take on {typ}" .format (
432+ raise IndexError ("cannot do a non-empty take from an empty axes|out of bounds on {typ}" .format (
427433 typ = self .__class__ .__name__ ,
428434 ))
429435
@@ -526,6 +532,8 @@ def fillna(self, value=None, method=None, limit=None):
526532 if method is not None :
527533 func = get_fill_func (method )
528534 new_values = func (self .astype (object ), limit = limit , mask = mask )
535+ # From pandas 1.3, get_fill_func also return mask
536+ new_values = new_values [0 ] if isinstance (new_values , tuple ) else new_values
529537 new_values = self ._from_sequence (new_values , self ._dtype )
530538 else :
531539 # fill with value
0 commit comments