@@ -3811,6 +3811,8 @@ def _getitem_multilevel(self, key):
38113811 # string in the key. If the result is a Series, exclude the
38123812 # implied empty string from its name.
38133813 if len (result .columns ) == 1 :
3814+ # e.g. test_frame_getitem_multicolumn_empty_level,
3815+ # test_frame_mixed_depth_get, test_loc_setitem_single_column_slice
38143816 top = result .columns [0 ]
38153817 if isinstance (top , tuple ):
38163818 top = top [0 ]
@@ -7822,13 +7824,13 @@ def combine(
78227824 result = {}
78237825 for col in new_columns :
78247826 series = this [col ]
7825- otherSeries = other [col ]
7827+ other_series = other [col ]
78267828
78277829 this_dtype = series .dtype
7828- other_dtype = otherSeries .dtype
7830+ other_dtype = other_series .dtype
78297831
78307832 this_mask = isna (series )
7831- other_mask = isna (otherSeries )
7833+ other_mask = isna (other_series )
78327834
78337835 # don't overwrite columns unnecessarily
78347836 # DO propagate if this column is not in the intersection
@@ -7838,9 +7840,9 @@ def combine(
78387840
78397841 if do_fill :
78407842 series = series .copy ()
7841- otherSeries = otherSeries .copy ()
7843+ other_series = other_series .copy ()
78427844 series [this_mask ] = fill_value
7843- otherSeries [other_mask ] = fill_value
7845+ other_series [other_mask ] = fill_value
78447846
78457847 if col not in self .columns :
78467848 # If self DataFrame does not have col in other DataFrame,
@@ -7855,9 +7857,9 @@ def combine(
78557857 # if we have different dtypes, possibly promote
78567858 new_dtype = find_common_type ([this_dtype , other_dtype ])
78577859 series = series .astype (new_dtype , copy = False )
7858- otherSeries = otherSeries .astype (new_dtype , copy = False )
7860+ other_series = other_series .astype (new_dtype , copy = False )
78597861
7860- arr = func (series , otherSeries )
7862+ arr = func (series , other_series )
78617863 if isinstance (new_dtype , np .dtype ):
78627864 # if new_dtype is an EA Dtype, then `func` is expected to return
78637865 # the correct dtype without any additional casting
@@ -9919,7 +9921,7 @@ def _dict_round(df: DataFrame, decimals):
99199921 except KeyError :
99209922 yield vals
99219923
9922- def _series_round (ser : Series , decimals : int ):
9924+ def _series_round (ser : Series , decimals : int ) -> Series :
99239925 if is_integer_dtype (ser .dtype ) or is_float_dtype (ser .dtype ):
99249926 return ser .round (decimals )
99259927 return ser
0 commit comments