Created
October 25, 2016 00:06
-
-
Save kylebarlow/648b5392c1a74ca45696e02b624518f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
def get_mutant_part_of_string(s): | |
return s.split()[1][-1] | |
df = pd.read_csv('/home/kyle/Downloads/uby_1ubq.tsv', sep='\t') | |
print df.head() | |
df.loc[:,'mut_aa'] = pd.Series(df['Mutation'].apply(get_mutant_part_of_string), index=df.index) | |
print df.head() | |
print df[ df.mut_aa == 'C' ].head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment