我有一个制表符分隔的文件(
我该如何实现这个目标?
mydata.txt
)如下:Set Coolthing Route Organ Up Down
set4 foo ID LN 81 60
set4 bar ID LN 542 92
set4 foo ID LV 73 73
set4 bar ID LV 143 78
set4 foo ID SP 32 82
set4 bar ID SP 90 129
以下是相关代码:
import pandas as pd
df = pd.io.parsers.read_table("http://dpaste.com/3ZTTVQH.txt")
df = df.pivot(index="Coolthing",columns="Organ")
df.drop('Set',axis=1,inplace=True)
df.drop('Route',axis=1,inplace=True)
I have the following data frame:
In [15]: df
Out[15]:
Up Down
Organ LN LV SP LN LV SP
Coolthing
bar 542 143 90 92 78 129
foo 81 73 32 60 73 82
然后使用df.to_html(index=True, justify="left")
创建这个HTML:
我想要做的是移除索引名称Organ
和Coolthing
,得到以下结果:
Up Down
LN LV SP LN LV SP
bar 542 143 90 92 78 129
foo 81 73 32 60 73 82
我该如何实现这个目标?