-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Closed
Labels
ExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.Missing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Milestone
Description
lib.is_scalar
is a bit too strict for the check we do in
pandas/pandas/core/arrays/base.py
Line 272 in 7273ea0
if not is_scalar(value): |
ipaddress.IPv4Address
as a scalar.
In [1]: from pandas._libs import lib
In [2]: import ipaddress
In [3]: lib.is_scalar(ipaddress.IPv4Address(1))
Out[3]: False
Replacing that check with a hasattr(value, '__len__')
should be sufficient.
Metadata
Metadata
Assignees
Labels
ExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.Missing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolate