Error when calculating variance of series of ndarrays #25542
Labels
Enhancement
Error Reporting
Incorrect or improved errors from pandas
Nested Data
Data where the values are collections (lists, sets, dicts, objects, etc.).
Reduction Operations
sum, mean, min, max, etc.
Code Sample, a copy-pastable example if possible
Problem description
A Pandas series od dtype object can contain numpy.ndarrays. This ist useful to store high-dimensional data in DataFrames.
Calculating the mean of such a series works as expected. Calculating the variance however, yields an error. The calculation is easily performed by inserting .values between the series and the var call, so it is no fundamental problem.
This is the error Traceback of df[0].var()
Expected Output
I expect
df[0].var()
to yield the same as
df[0].values.var(axis=0)
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]INSTALLED VERSIONS
commit: None
python: 3.6.3.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntel
byteorder: little
LC_ALL: None
LANG: en
LOCALE: None.None
pandas: 0.24.1
pytest: 3.2.3
pip: 18.1
setuptools: 39.2.0
Cython: 0.27.2
numpy: 1.14.5
scipy: 1.1.0
pyarrow: 0.7.1
xarray: 0.9.6
IPython: 6.2.1
sphinx: 1.6.5
patsy: 0.4.1
dateutil: 2.6.1
pytz: 2017.2
blosc: 1.5.1
bottleneck: 1.2.1
tables: None
numexpr: None
feather: 0.4.0
matplotlib: 2.1.0
openpyxl: None
xlrd: 1.1.0
xlwt: None
xlsxwriter: 1.0.2
lxml.etree: 4.1.0
bs4: 4.6.0
html5lib: 0.9999999
sqlalchemy: 1.1.14
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: