@@ -1343,7 +1343,6 @@ def pad_or_backfill(
1343
1343
self ,
1344
1344
* ,
1345
1345
method : FillnaOptions ,
1346
- axis : AxisInt = 0 ,
1347
1346
inplace : bool = False ,
1348
1347
limit : int | None = None ,
1349
1348
limit_area : Literal ["inside" , "outside" ] | None = None ,
@@ -1357,16 +1356,12 @@ def pad_or_backfill(
1357
1356
# Dispatch to the NumpyExtensionArray method.
1358
1357
# We know self.array_values is a NumpyExtensionArray bc EABlock overrides
1359
1358
vals = cast (NumpyExtensionArray , self .array_values )
1360
- if axis == 1 :
1361
- vals = vals .T
1362
- new_values = vals ._pad_or_backfill (
1359
+ new_values = vals .T ._pad_or_backfill (
1363
1360
method = method ,
1364
1361
limit = limit ,
1365
1362
limit_area = limit_area ,
1366
1363
copy = copy ,
1367
- )
1368
- if axis == 1 :
1369
- new_values = new_values .T
1364
+ ).T
1370
1365
1371
1366
data = extract_array (new_values , extract_numpy = True )
1372
1367
return [self .make_block_same_class (data , refs = refs )]
@@ -1814,7 +1809,6 @@ def pad_or_backfill(
1814
1809
self ,
1815
1810
* ,
1816
1811
method : FillnaOptions ,
1817
- axis : AxisInt = 0 ,
1818
1812
inplace : bool = False ,
1819
1813
limit : int | None = None ,
1820
1814
limit_area : Literal ["inside" , "outside" ] | None = None ,
@@ -1827,11 +1821,11 @@ def pad_or_backfill(
1827
1821
elif limit_area is not None :
1828
1822
raise NotImplementedError (
1829
1823
f"{ type (values ).__name__ } does not implement limit_area "
1830
- "(added in pandas 2.2). 3rd-party ExtnsionArray authors "
1824
+ "(added in pandas 2.2). 3rd-party ExtensionArray authors "
1831
1825
"need to add this argument to _pad_or_backfill."
1832
1826
)
1833
1827
1834
- if values .ndim == 2 and axis == 1 :
1828
+ if values .ndim == 2 :
1835
1829
# NDArrayBackedExtensionArray.fillna assumes axis=0
1836
1830
new_values = values .T ._pad_or_backfill (** kwargs ).T
1837
1831
else :
0 commit comments