Skip to content

Commit 7402460

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent cd4c458 commit 7402460

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7235,7 +7235,7 @@ def sort_values(
72357235
indexer = lexsort_indexer(
72367236
keys_data, orders=ascending, na_position=na_position, key=key
72377237
)
7238-
elif len(by):
7238+
elif by:
72397239
# len(by) == 1
72407240

72417241
k = self._get_label_or_level_values(by[0], axis=axis)

pandas/core/indexes/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7635,7 +7635,7 @@ def ensure_index(index_like: Axes, copy: bool = False) -> Index:
76357635
# check in clean_index_list
76367636
index_like = list(index_like)
76377637

7638-
if len(index_like) and lib.is_all_arraylike(index_like):
7638+
if index_like and lib.is_all_arraylike(index_like):
76397639
from pandas.core.indexes.multi import MultiIndex
76407640

76417641
return MultiIndex.from_arrays(index_like)

pandas/io/parsers/base_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def extract(r):
243243
names.insert(single_ic, single_ic)
244244

245245
# Clean the column names (if we have an index_col).
246-
if len(ic):
246+
if ic:
247247
col_names = [
248248
r[ic[0]]
249249
if ((r[ic[0]] is not None) and r[ic[0]] not in self.unnamed_cols)

pandas/io/parsers/python_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def read(
281281

282282
index: Index | None
283283
columns: Sequence[Hashable] = list(self.orig_names)
284-
if not len(content): # pragma: no cover
284+
if not content: # pragma: no cover
285285
# DataFrame with the right metadata, even though it's length 0
286286
# error: Cannot determine type of 'index_col'
287287
names = dedup_names(

pandas/tests/arithmetic/test_datetime64.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
)
1010
from itertools import (
1111
product,
12-
starmap,
1312
)
1413
import operator
1514

@@ -2211,7 +2210,7 @@ def test_timedelta64_equal_timedelta_supported_ops(self, op, box_with_array):
22112210

22122211
def timedelta64(*args):
22132212
# see casting notes in NumPy gh-12927
2214-
return np.sum(list(starmap(np.timedelta64, zip(args, intervals))))
2213+
return np.sum(list(map(np.timedelta64, args, intervals)))
22152214

22162215
for d, h, m, s, us in product(*([range(2)] * 5)):
22172216
nptd = timedelta64(d, h, m, s, us)

0 commit comments

Comments
 (0)