question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: TypeError: _reconstruct: First argument must be a sub-type of ndarray

See original GitHub issue
  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Code Sample

import pandas as pd
pd.read_pickle("filtered_data.pickle")

Problem description

I am able to import the dataframe (which can be downloaded in zipped form from here) with Pandas version 0.24.2 but get the following error with version 1.0.3:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/homes/jua23/.virtualenvs/arch_uncert/lib/python3.7/site-packages/pandas/io/pickle.py", line 182, in read_pickle
    return pickle.load(f)
TypeError: _reconstruct: First argument must be a sub-type of ndarray

Output of pd.show_versions()

INSTALLED VERSIONS

commit : None python : 3.7.7.final.0 python-bits : 64 OS : Linux OS-release : 5.3.0-42-generic machine : x86_64 processor : x86_64 byteorder : little LC_ALL : None LANG : en_GB.UTF-8 LOCALE : en_GB.UTF-8

pandas : 1.0.3 numpy : 1.18.2 pytz : 2019.3 dateutil : 2.8.1 pip : 20.0.2 setuptools : 46.0.0 Cython : 0.29.15 pytest : None hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : None lxml.etree : None html5lib : None pymysql : None psycopg2 : None jinja2 : 2.11.1 IPython : 7.13.0 pandas_datareader: None bs4 : None bottleneck : None fastparquet : None gcsfs : None lxml.etree : None matplotlib : 3.2.1 numexpr : None odfpy : None openpyxl : None pandas_gbq : None pyarrow : None pytables : None pytest : None pyxlsb : None s3fs : None scipy : 1.4.1 sqlalchemy : None tables : None tabulate : None xarray : None xlrd : None xlwt : None xlsxwriter : None numba : None

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
JamesAllinghamcommented, Nov 19, 2020

Hey Neil! Yes, here you go: https://www.dropbox.com/s/sxf3z1g7ltr60dy/filtered_data2.pickle?dl=0

Let me know If that doesn’t work.

By the way, what is the source for this file? I acquired it through a long chain of people. It would be good to know where the official source is!

1reaction
lawrenndcommented, Nov 20, 2020

Thanks James!

Nicolò Fusi @nfusi pulled it together for the Hensman, Fusi and Lawrence UAI 2013 GPs for Big Data paper.

It should be available via the pods software (pip install pods), but the software had the bug that’s flagged here (pickle is a real pain for data) … there’s a jupyter notebook for it here:

https://github.com/sods/ods/blob/master/notebooks/pods/datasets/airline-delay.ipynb

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pandas backwards compatibility issue with pickle 0.14.1 and ...
The error message you are seeing `TypeError: _reconstruct: First argument must be a sub-type of ndarray is that the python default unpickler makes...
Read more >
NumPy User Guide
TypeError : array() takes from 1 to 2 positional arguments but 4 were ... The first rule of broadcasting is that if all...
Read more >
Programming guide — siuba version v0.4.1-3-gdf88cc0
You may be wondering how a siuba function, like mutate, could work on a SQL ... The function's first positional argument is not...
Read more >
CuPy Documentation - Read the Docs
CuPy is a NumPy/SciPy-compatible array library for GPU-accelerated computing with Python. CuPy acts as a drop-in.
Read more >
NumPy User Guide - Numpy and Scipy Documentation
is built with gfortran, you must build numpy/scipy with gfortran. ... to Intrepid or later versions, you should rebuild everything from.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found