【上海校区】Python读取表格分界符不对

python 未结 0 181
什么是网站优化
什么是网站优化 2021-04-27 10:27
悬赏:36
import pandas as pd
unames = ["user_id","gender","age","occupation","zip"]
users = pd.read_table("ml-1m/users.dat" , sep = None, header = None , names = unames)
提示这个错误,ParserWarning: Falling back to the "python" engine because the "c" engine does not support regex separators

有人说是表格分界符不对。然后改成

sep = None
更加报错,坑人的度娘。解决方法:加上 engine=‘python‘

就可以了。



相关标签:
回答
  • 消灭零回复
提交回复