Skip to content

Commit 98d68a2

Browse files
committed
don't use .map
1 parent 9baff51 commit 98d68a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rdt/transformers/categorical.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ def _order_categories(self, unique_data):
5959
nans = pd.isna(unique_data)
6060
if self.order_by == 'alphabetical':
6161
# pylint: disable=invalid-unary-operand-type
62-
if any(map(lambda item: not isinstance(item, str), unique_data[~nans])): # noqa: C417
62+
if any(not isinstance(item, str) for item in unique_data[~nans]):
6363
raise TransformerInputError(
6464
"The data must be of type string if order_by is 'alphabetical'."
6565
)
6666
elif self.order_by == 'numerical_value':
67-
if any(map(lambda item: not np.issubdtype(type(item), np.number), unique_data[~nans])): # noqa: C417
67+
if any(not np.issubdtype(type(item), np.number) for item in unique_data[~nans]):
6868
raise TransformerInputError(
6969
"The data must be numerical if order_by is 'numerical_value'."
7070
)

0 commit comments

Comments
 (0)