lundi 6 novembre 2017

If/Elseif Condition on a Dataframe combined with multiple actions

I have a dataframe object column which looks like 104.5 and always has a suffix like K, B or M standing for Kilo, Billions or Millions. For instance 104.5B.

What I would like to do is to check for the suffix and multiple the value by 10^3, 10^6 or 10^9 'inplace'.

I found some explanations for labeling a new column, but nothing like a multiplication in place. How am I doing it smart?

Aucun commentaire:

Enregistrer un commentaire