Python 从pickle文件中读取的数据帧似乎不可能在pandas中读取

Python 从pickle文件中读取的数据帧似乎不可能在pandas中读取,python,pandas,dataframe,pickle,Python,Pandas,Dataframe,Pickle,如果我跑 import pandas as pd df = pd.read_pickle('test.pkl.gz') len(df) 我得到以下错误: AttributeError: 'DataFrame' object has no attribute '_data' 如果我尝试df.head(),我会得到: RecursionError: maximum recursion depth exceeded RecursionError: maximum recursion depth

如果我跑

import pandas as pd
df = pd.read_pickle('test.pkl.gz')
len(df)
我得到以下错误:

AttributeError: 'DataFrame' object has no attribute '_data'
如果我尝试
df.head()
,我会得到:

RecursionError: maximum recursion depth exceeded
RecursionError: maximum recursion depth exceeded while calling a Python object
如果我尝试
df.shape
,我会得到:

RecursionError: maximum recursion depth exceeded
RecursionError: maximum recursion depth exceeded while calling a Python object
sys.getsizeof(df)
抛出:

'DataFrame' object has no attribute '_data'

但原始文件大小应为10.5MB

我不确定您想做什么,因为我怀疑该文件已损坏或是使用其他版本的python@manu190466您很可能是对的,我将尝试生成一个新文件,然后重试