@@ -2052,7 +2052,6 @@ def dot(self, other):
2052
2052
lvals = left .values
2053
2053
rvals = right .values
2054
2054
else :
2055
- left = self
2056
2055
lvals = self .values
2057
2056
rvals = np .asarray (other )
2058
2057
if lvals .shape [0 ] != rvals .shape [0 ]:
@@ -2480,7 +2479,8 @@ def sort_values(self, axis=0, ascending=True, inplace=False,
2480
2479
dtype: object
2481
2480
"""
2482
2481
inplace = validate_bool_kwarg (inplace , 'inplace' )
2483
- axis = self ._get_axis_number (axis )
2482
+ # Validate the axis parameter
2483
+ self ._get_axis_number (axis )
2484
2484
2485
2485
# GH 5856/5853
2486
2486
if inplace and self ._is_cached :
@@ -2652,7 +2652,8 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
2652
2652
# TODO: this can be combined with DataFrame.sort_index impl as
2653
2653
# almost identical
2654
2654
inplace = validate_bool_kwarg (inplace , 'inplace' )
2655
- axis = self ._get_axis_number (axis )
2655
+ # Validate the axis parameter
2656
+ self ._get_axis_number (axis )
2656
2657
index = self .index
2657
2658
2658
2659
if level is not None :
@@ -3073,7 +3074,8 @@ def _gotitem(self, key, ndim, subset=None):
3073
3074
versionadded = '.. versionadded:: 0.20.0' ,
3074
3075
** _shared_doc_kwargs ))
3075
3076
def aggregate (self , func , axis = 0 , * args , ** kwargs ):
3076
- axis = self ._get_axis_number (axis )
3077
+ # Validate the axis parameter
3078
+ self ._get_axis_number (axis )
3077
3079
result , how = self ._aggregate (func , * args , ** kwargs )
3078
3080
if result is None :
3079
3081
@@ -3919,8 +3921,8 @@ def dropna(self, axis=0, inplace=False, **kwargs):
3919
3921
if kwargs :
3920
3922
raise TypeError ('dropna() got an unexpected keyword '
3921
3923
'argument "{0}"' .format (list (kwargs .keys ())[0 ]))
3922
-
3923
- axis = self ._get_axis_number (axis or 0 )
3924
+ # Validate the axis parameter
3925
+ self ._get_axis_number (axis or 0 )
3924
3926
3925
3927
if self ._can_hold_na :
3926
3928
result = remove_na_arraylike (self )
0 commit comments