You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Taking a look at this now. The fix is quite simple
diff --git a/pandas/core/arrays/numpy_.py b/pandas/core/arrays/numpy_.py
index 47517782e..791ff4430 100644
--- a/pandas/core/arrays/numpy_.py+++ b/pandas/core/arrays/numpy_.py@@ -222,7 +222,7 @@ class PandasArray(ExtensionArray, ExtensionOpsMixin, NDArrayOperatorsMixin):
item = item._ndarray
result = self._ndarray[item]
- if not lib.is_scalar(result):+ if not lib.is_scalar(item):
result = type(self)(result)
return result
but I'm trying to figure out a way to robustly test this.
Code Sample, a copy-pastable example if possible
It seems to be related to calling
self.array
on the series which might makes sense given PandasArray is supposed be 1-dimensionalThis also happens with Python objects
Problem description
The current behavior is a problem because if a dataframe has a column with non-standard data like tuples the
.memory_usage(deep=True)
call fails.Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.7.1.final.0
python-bits: 64
OS: Linux
OS-release: 4.15.0-43-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.24.0
pytest: 3.8.2
pip: 18.1
setuptools: 40.6.2
Cython: None
numpy: 1.16.0
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 7.1.1
sphinx: 1.8.1
patsy: None
dateutil: 2.7.5
pytz: 2018.7
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 3.0.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: 0.2.0
fastparquet: 0.2.1
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: