【问题标题】:How to read a .p archive whit pandas in Python?如何在 Python 中读取带有熊猫的 .p 存档文件?
【发布时间】:2021-01-17 10:45:47
【问题描述】:

我有一个“.p”存档,我从未在 pandas 中使用过这种扩展,我尝试使用“read_csv”函数读取此存档,但出现错误。

我试过了:

import pandas as pd

taxi_owners = pd.read_csv('taxi_owners.p', encoding='utf-8')

但这不起作用,结果是:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte

感谢您的帮助

【问题讨论】:

标签: python pandas data-science data-analysis


【解决方案1】:

很可能是一个泡菜文件。请尝试以下操作:

data = pd.read_pickle('taxi_owners.p')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-27
    • 1970-01-01
    • 2016-08-02
    相关资源
    最近更新 更多