文本挖掘 python中遇到的问题

  1. ParserWarning: Falling back to the ‘python’ engine because the ‘c’ engine does not support regex separators (separators > 1 char and different from ‘\s+’ are interpreted as regex); you can avoid this warning by specifying engine=‘python’.
    df = pd.read_csv(‘E:\文本挖掘\鬼吹灯-精绝古城.txt’,sep=‘aaa’,encoding=‘GBK’,names=[‘txt’])

解决方法:
df = pd.read_csv(‘E:\文本挖掘\鬼吹灯-精绝古城.txt’,sep=‘aaa’,encoding=‘GBK’,names=[‘txt’])
变为
df = pd.read_csv(‘E:\文本挖掘\鬼吹灯-精绝古城.txt’,sep=‘aaa’,engine=‘python’,encoding=‘GBK’,names=[‘txt’])

猜你喜欢

转载自blog.csdn.net/tumantou2hao/article/details/88069257