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

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

如题,使用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')

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/langs/943000.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-18
下一篇 2022-05-18

发表评论

登录后才能评论

评论列表(0条)

保存