当前位置: 首页 > 工具软件 > engine > 使用案例 >

Python报【Falling back to the ‘python‘ engine because the ‘c‘ engine does not support skipfooter】的解决方案

南宫龙野
2023-12-01

如题,使用pandas读取txt数据时,报如下警告:
D:\Program Files\python3.7\lib\site-packages\pandas\util_decorators.py:311: ParserWarning: Falling back to the ‘python’ engine because the ‘c’ engine does not support skipfooter; you
can avoid this warning by specifying engine=‘python’.
return func(*args, **kwargs)

要不说python友好呢,都直接给出了解决方案,在参数列表添加engine='python',如下:

# 报错前
data = pd.read_table("txt.txt", header=None, sep = '\t', skiprows=1, skipfooter=1)

# 报错后
data = pd.read_table("txt.txt", header=None, sep = '\t', skiprows=1, skipfooter=1,engine='python')
 类似资料: