import pandas as pd
df = pd.DataFrame(pd.read_csv("C483CEC010_PTM_20190416.csv"))
df.head()
df.tail()
df.columns.tolist()
df.columns.tolist
df.columns
df.loc[1]
df.loc[3:6]
df.loc[[2,4,6]]
df[["Avg MS Area: E","Mono Mass Exp."]]
exp_list = []
area_list = []
for col in df.columns.tolist():
if col.endswith("Exp."):
exp_list.append(col)
elif col.startswith("Avg MS Area:"):
area_list.append(col)
df[area_list].head(3)
modification = open("modification.txt").read().strip().split()
fd = df.loc[(df.Modification.isin(modification)) & (abs(df['Delta (ppm)']) <= 10) & (df['Confidence Score'] >= 80)]
del fd["No."]
del fd["Level"]
'''
df = df.loc[(~df["Modification"].isna()) & (~df['Delta (ppm)'].isna())]#需要么?
df = df.loc[(df.Modification.isin(modification)) & (abs(df['Delta (ppm)']) <= 10) & (df['Confidence Score'] >= 80)]
for m in df["Modification"]:
for s in df["Site"]:
df = df.loc[(~df["Modification"].isna()) & (~df['Delta (ppm)'].isna())]
df = df.loc[
(df.Modification.isin(modification)) & (abs(df['Delta (ppm)']) <= 10) & (df['Confidence Score'] >= 80)]
'''