NBMG-UNR / resourcespace-migration

Code and tasks related to migrating GBSSRL into a CMS
0 stars 1 forks source link

Update clean_md_commodities.py #19

Closed lweeks20 closed 4 years ago

lweeks20 commented 4 years ago

@emilyodean Hey so I dont know why I've had such a hard time with this I followed what the stackoverflow was saying and all the excel sheets I tried still didn't apply my changes. You dont have to accept these changes I just wanted to show that there was work being done. I apologize for the struggles.

emilyodean commented 4 years ago

@lweeks20 Going back to my email: "You need to save the updated dataframe back to the original"

From the stackoverflow page: "You need to assign back" df = df.replace('white', np.nan)

So, to get you started with a one line example - df1.replace(to_replace ='BAIRITE', value ="BARYTE", regex= True) should be df1 = df1.replace(to_replace ='BAIRITE', value ="BARYTE", regex= True)