【发布时间】:2020-06-12 09:05:42
【问题描述】:
我有模型字段实例。
myCsv = myFile.objects.get(id=1) // myCsv.document is models.FileField
并且想把它放在熊猫中。
df = pd.read_csv(thred.document.read())
OSError: Expected file path name or file-like object, got <class 'bytes'> type
如何将 cev 文件放入 pandas 对象??
【问题讨论】:
-
试试
df = pd.read_csv(thred.document)