Last active
September 6, 2015 04:58
-
-
Save satishkt/bd78e18844e3b0edb2d8 to your computer and use it in GitHub Desktop.
gist_to_load_clean_data_file
This file contains 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
def clean_data(filenames): | |
dfs=[] | |
for filename in filenames: | |
epic_df = pd.read_csv(filename,names=['col'],header=None) | |
epic_df['cuisine']=epic_df['col'].apply(lambda x : x.split('\t')[0]) | |
epic_df['ingredients'] = epic_df['col'].apply(lambda x:(',').join (x.split('\t')[1:])) | |
epic_df.drop('col',inplace=True,axis=1) | |
dfs.append(epic_df) | |
return dfs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment