We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6cbf18e commit 192bcecCopy full SHA for 192bcec
pandas/core/series.py
@@ -511,7 +511,7 @@ def _init_dict(
511
elif index is not None:
512
# fastpath for Series(data=None). Just use broadcasting a scalar
513
# instead of reindexing.
514
- if len(index):
+ if len(index) or dtype is not None:
515
values = na_value_for_dtype(pandas_dtype(dtype), compat=False)
516
else:
517
values = []
0 commit comments