I have a column in my data frame df
called Ratio
which comprises of two positive integers x
and y
separated by a /
[That is, format the is x/y
]. I would like to replace each row in this column by integer((x/y)*10)
(rounded off to the nearest integer)
Example, if that value of an element in Ratio
is 14/20
I need to change it to 7
.
[There is a level 0/0
in the Ratio
column in which case I would like it changed to 5
]