@创建于:20210407
@修改于:20210407
1、问题描述
python pandas 读csv文件遇到如下报错:
ValueError: Falling back to the ‘python’ engine because the separator encoded in utf-8 is > 1 char long, and the ‘c’ engine does not support such separators, but this causes ‘low_memory’ to be ignored as it is not supported by the ‘python’ engine.
2、解决办法
我的问题在于csv是英文分号,而在读的时候用的是中文分号。
if os.path.exists("data/test.csv"):
df_day = pd.read_csv(filepath_or_buffer=

本文讲述了在使用pandas读取csv文件时遇到的ValueError,原因在于文件中英文分号被误识别为中文分号。解决方案包括直接修改分号字符和指定engine='python'。关键词涉及pandas、csv读取、UTF-8编码和engine设置。
最低0.47元/天 解锁文章
15万+

被折叠的 条评论
为什么被折叠?



