Very new to panda and trying to practice so I can handle bigger data size. I'm trying to create a conditional statement using 3 criteria: Gene, Locus, and . If Gene and Locus are matching (identical), compare FPKM between those two and delete the data with smaller FPKM. Else move onto the next Gene and repeat the process. So it keeps filtering out duplicates.
So far this is what I've tried:
#if Gene and Locus are the same
if s_filt.loc[s_filt['Gene'] == s_filt['Gene']] and s_filt.loc[s_filt['Locus'] ==s_filt.loc['Locus']]=True:
if s_filt['q0_FPKM'] > s_filt['q0_FPKM']: #compare q0_FPKM
s_filter.drop() #delete entire row with smaller q0_FPKM
else:
pass
Feeling a bit picked how to frame the second criteria (compare FPKM) and deleting the data which doesn't meet the criteria.
Apologies in advance if I'm making rookie mistakes here, still learning...