pandas 读取txt seq分隔符类型 engine指定引擎 header 不将第一行作为列名

untitled.txt 文本内容
One ---- I have a car.
Two ---- My name is Hany.

 

df = pd.read_table('untitled.txt',sep=' \-\-\-\- ',engine = 'python',header = None)

注:其中的 seq 为正则表达式
需要指定 engine 为 python
根据文件的内容来确定是否需要 header

 

posted @ 2021-10-06 14:23  CodeYaSuo  阅读(250)  评论(0编辑  收藏  举报