Skip to content

Commit

Permalink
Backport PR pandas-dev#57889: BUG: Handle Series construction with Da…
Browse files Browse the repository at this point in the history
…sk, dict-like, Series
  • Loading branch information
mroeschke authored and meeseeksmachine committed Mar 18, 2024
1 parent 71a6797 commit 95e2e2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def __init__(
data = data.reindex(index, copy=copy)
copy = False
data = data._mgr
elif is_dict_like(data):
elif isinstance(data, Mapping):
data, index = self._init_dict(data, index, dtype)
dtype = None
copy = False
Expand Down Expand Up @@ -605,7 +605,7 @@ def __init__(
)

def _init_dict(
self, data, index: Index | None = None, dtype: DtypeObj | None = None
self, data: Mapping, index: Index | None = None, dtype: DtypeObj | None = None
):
"""
Derive the "_mgr" and "index" attributes of a new Series from a
Expand Down

0 comments on commit 95e2e2d

Please sign in to comment.