Skip to content

Commit 4655d7b

Browse files
committed
Fixed mypy static type analysis issue
1 parent 510bce6 commit 4655d7b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pandas/core/series.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,17 +358,15 @@ def _init_dict(self, data, index=None, dtype=None):
358358
# Using the below way for generating keys and values
359359
# increasing the performance by 50%, instead of zip
360360
keys = tuple(data.keys())
361-
values = [
362-
data[key] for key in keys
363-
] # Generating list of values- faster way
364-
361+
values = list(data.values()) # Generating list of values- faster way
362+
365363
elif index is not None:
366364
# fastpath for Series(data=None). Just use broadcasting a scalar
367365
# instead of reindexing.
368366
values = na_value_for_dtype(dtype)
369367
keys = index
370368
else:
371-
keys, values = [], []
369+
keys, values = tuple([]), []
372370

373371
# Input is now list-like, so rely on "standard" construction:
374372

0 commit comments

Comments
 (0)