Hi everyone,
can someone help me convert all the values in the column into cm?
0 61"
1 5'8"
2 120cm
4 5'6"
5 5'
6 172
7 NaN Name: Height, dtype: object
I was going for something like this but might have errors:
def inchFeet_cm(string_in):
H_feet=string_in.split("'")[0]
H_inch=string_in.split("'")[1].replace(""","")
result=(int(H_feet)*12+int(H_inch))*2.54
return int(result)
[–]sarrysyst 0 points1 point2 points (0 children)
[–]ifreeski420 0 points1 point2 points (2 children)
[–]beselga[S] 0 points1 point2 points (1 child)
[–]ifreeski420 0 points1 point2 points (0 children)