在我写这篇文章之前,我检查了类似的问题,也尝试使用try/except。。。在那里尝试什么都不做,除了打印错误的线条,但无法解决我的问题。所以目前我有:
import pandas as pd
import chardet
# Read the file
with open("full_data.csv", 'rb') as f:
result = chardet.detect(f.read()) # or readline if the file is large
df1 = pd.read_csv("full_data.csv", sep=';',
encoding=result['encoding'], error_bad_lines=False, low_memory=False, quoting=csv.QUOTE_NONE)
但我还是得到了一个错误:
^{pr2}$在open csv中是否有类似error='replace'的选项?或任何其他解决方案
使用引擎选项解决了我的问题:
相关问题 更多 >
编程相关推荐