其实就是书上的代码,我用的代码是,下面酱紫
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‘
就可以了。