我正在尝试将以下标签中的数据分成pandas:
test.txt:
col_a\tcol_b\tcol_c\tcol_d
4\t3\t2\t1
4\t3\t2\t1
Run Code Online (Sandbox Code Playgroud)
我导入test.txt如下:
pd.read_csv('test.txt',sep='\t')
Run Code Online (Sandbox Code Playgroud)
结果数据框有1列.\ t不会被识别为选项卡.
如果我用'键盘选项卡'替换\ t,则正确解析文件.我也尝试用\ t和/ t替换'\ t',但没有任何运气.
在此先感谢您的帮助.
奥马尔