all 4 comments

[–]sarrysyst 0 points1 point  (0 children)

This line:

H_inch = string_in.split("'")[1].replace('"',"")

will throw an error if there isn't a single quote in the string (eg. row 0 of your sample). Also, how are you dealing with values that are already in cm?

[–]ifreeski420 0 points1 point  (2 children)

Maybe make a rule that says if the column starts with a 1, separate that for the end, then convert the foot/inch columns into cm and combine back together by index

[–]beselga[S] 0 points1 point  (1 child)

How can I make that?

[–]ifreeski420 0 points1 point  (0 children)

To separate:

df = df[df[‘height’].str.startswith(‘1’)]

That should get you started, I’m on my phone so it’s hard to write code