data extraction tidy up

This commit is contained in:
Tanushree Tunstall 2020-07-08 13:26:33 +01:00
parent a4670b9944
commit c958cc1081
2 changed files with 195 additions and 105 deletions

View file

@ -18,7 +18,9 @@ import pandas as pd
#os.chdir(homedir + '/git/LSHTM_analysis/scripts')
#os.getcwd()
#%%=====================================================================
# define the split function
# tidy_split():Function to split mutations on specified delimiter: ';'
#https://stackoverflow.com/questions/41476150/removing-space-from-dataframe-columns-in-pandas
def tidy_split(df, column, sep = '|', keep = False):
'''
Split the values of a column and expand so the new DataFrame has one split