Specific conditions for string replacement?
Maybe try something like this:
df['column'] = df['column'].astype(str).replace('_MM','|MM')
df['column'] = df['column'].astype(str).replace('GCA_','GCA')
I was wondering if it were possible to iterate over a pandas column and replace strings if a particular condition was met.  Essentialy I have a dataframe column with 100s of strings all in the general format GCA_XXXXX.X_MMXXXX.X, although some are in the XXXX_MMXXXX.X format, and I need to remove one of that dashes and replace with '|' and only if it is followed by MM, if it is AFTER GCA then I need it to be replaced form '_' to ''.  Is there any way in python that I can set this conditions and iterate a function over the column? thanks!