How to efficiently apply a function to every row in a dataframe
How to efficiently apply a function to every row in a dataframe Question: Given the following table: df = pd.DataFrame({‘code’:[‘100M’,’60M10N40M’,’5S99M’,’1S25I100M’,’1D1S1I200M’]}) that looks like this: code 0 100M 1 60M10N40M 2 5S99M 3 1S25I100M 4 1D1S1I200M I’d like to convert the code column strings to numbers where M, N, D are each equivalent to (times 1), …