Skip to content

Commit 6940ca4

Browse files
jbrockmendelSeeminSyed
authored andcommitted
CLN: remove align kwarg from Block.where, Block.putmask (pandas-dev#32791)
1 parent 762a01d commit 6940ca4

File tree

1 file changed

+5
-32
lines changed

1 file changed

+5
-32
lines changed

pandas/core/internals/blocks.py

+5-32
Original file line numberDiff line numberDiff line change
@@ -909,13 +909,7 @@ def setitem(self, indexer, value):
909909
return block
910910

911911
def putmask(
912-
self,
913-
mask,
914-
new,
915-
align: bool = True,
916-
inplace: bool = False,
917-
axis: int = 0,
918-
transpose: bool = False,
912+
self, mask, new, inplace: bool = False, axis: int = 0, transpose: bool = False,
919913
):
920914
"""
921915
putmask the data to the block; it is possible that we may create a
@@ -927,7 +921,6 @@ def putmask(
927921
----------
928922
mask : the condition to respect
929923
new : a ndarray/object
930-
align : boolean, perform alignment on other/cond, default is True
931924
inplace : perform inplace modification, default is False
932925
axis : int
933926
transpose : boolean
@@ -1312,13 +1305,7 @@ def shift(self, periods, axis: int = 0, fill_value=None):
13121305
return [self.make_block(new_values)]
13131306

13141307
def where(
1315-
self,
1316-
other,
1317-
cond,
1318-
align: bool = True,
1319-
errors="raise",
1320-
try_cast: bool = False,
1321-
axis: int = 0,
1308+
self, other, cond, errors="raise", try_cast: bool = False, axis: int = 0,
13221309
) -> List["Block"]:
13231310
"""
13241311
evaluate the block; return result block(s) from the result
@@ -1327,8 +1314,6 @@ def where(
13271314
----------
13281315
other : a ndarray/object
13291316
cond : the condition to respect
1330-
align : bool, default True
1331-
Perform alignment on other/cond.
13321317
errors : str, {'raise', 'ignore'}, default 'raise'
13331318
- ``raise`` : allow exceptions to be raised
13341319
- ``ignore`` : suppress exceptions. On error return original object
@@ -1394,12 +1379,7 @@ def where_func(cond, values, other):
13941379
# we are explicitly ignoring errors
13951380
block = self.coerce_to_target_dtype(other)
13961381
blocks = block.where(
1397-
orig_other,
1398-
cond,
1399-
align=align,
1400-
errors=errors,
1401-
try_cast=try_cast,
1402-
axis=axis,
1382+
orig_other, cond, errors=errors, try_cast=try_cast, axis=axis,
14031383
)
14041384
return self._maybe_downcast(blocks, "infer")
14051385

@@ -1646,7 +1626,7 @@ def set(self, locs, values):
16461626
self.values[:] = values
16471627

16481628
def putmask(
1649-
self, mask, new, align=True, inplace=False, axis=0, transpose=False,
1629+
self, mask, new, inplace=False, axis=0, transpose=False,
16501630
):
16511631
"""
16521632
putmask the data to the block; we must be a single block and not
@@ -1658,7 +1638,6 @@ def putmask(
16581638
----------
16591639
mask : the condition to respect
16601640
new : a ndarray/object
1661-
align : boolean, perform alignment on other/cond, default is True
16621641
inplace : perform inplace modification, default is False
16631642
16641643
Returns
@@ -1896,13 +1875,7 @@ def shift(
18961875
]
18971876

18981877
def where(
1899-
self,
1900-
other,
1901-
cond,
1902-
align=True,
1903-
errors="raise",
1904-
try_cast: bool = False,
1905-
axis: int = 0,
1878+
self, other, cond, errors="raise", try_cast: bool = False, axis: int = 0,
19061879
) -> List["Block"]:
19071880
if isinstance(other, ABCDataFrame):
19081881
# ExtensionArrays are 1-D, so if we get here then

0 commit comments

Comments
 (0)