Skip to content

Commit e15e17e

Browse files
committed
CLN: Changed location of axis check
1 parent 51c5968 commit e15e17e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/core/generic.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4147,6 +4147,9 @@ def align(self, other, join='outer', axis=None, level=None, copy=True,
41474147
from pandas import DataFrame, Series
41484148
method = missing.clean_fill_method(method)
41494149

4150+
if axis is not None:
4151+
axis = self._get_axis_number(axis)
4152+
41504153
if broadcast_axis == 1 and self.ndim != other.ndim:
41514154
if isinstance(self, Series):
41524155
# this means other is a DataFrame, and we need to broadcast
@@ -4171,8 +4174,6 @@ def align(self, other, join='outer', axis=None, level=None, copy=True,
41714174
method=method, limit=limit,
41724175
fill_axis=fill_axis)
41734176

4174-
if axis is not None:
4175-
axis = self._get_axis_number(axis)
41764177
if isinstance(other, DataFrame):
41774178
return self._align_frame(other, join=join, axis=axis, level=level,
41784179
copy=copy, fill_value=fill_value,

0 commit comments

Comments
 (0)