用python 读取txt文件遇到的问题

import pandas as pd
movies_names = ['movie_id', 'title', 'genres']
movies = pd.read_table('movies.txt', sep='::', header=None, names=movies_names)
movies.head()

 程序报错

C:\Users\jinpeng\Anaconda3\lib\site-packages\ipykernel\__main__.py:3: 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'.
  app.launch_new_instance()

加上engine='python'就好了

import pandas as pd
movies_names = ['movie_id', 'title', 'genres']
movies = pd.read_table('movies.txt', sep='::', header=None, names=movies_names, engine='python')
movies.head()

你可能感兴趣的:(python)