pandas read table

http://pandas.pydata.org/pandas-docs/stable/10min.html

import pandas as pd

res = pd.read_table("ttest/ttest_expression.tsv",sep=",")

col_names = res.columns

row_indexs = res.index

res[0:0]

res[0:3]

res[0:3]["MU_1"]

res["SYMBOL"]

get the row values

res["MU_1"]

res["MU_1"][1]

res["MU_1"][0:9]

res.index = res[res.columns[0]]

res["MU_1"]["ABCC6"]

### get the row values 

Selection by Label

res.loc["ABCA2"]

res.loc["ABCA2","MU_1"]

res.loc[["ABCA2","ABCA3"],"MU_1"]

res.loc[["ABCA2","ABCA3"],["MU_1","MU_3"]]

res.loc[:,["MU_1","MU_3"]]

res.loc[["ABCA2","ABCA3"]]

res.iloc[3:5,0:2]

 m =res.to_dict()

m.keys()

原文地址:https://www.cnblogs.com/xiaojikuaipao/p/6242362.html