0

I want to convert an entire column in pandas form a string to a float.

In my column there is one figure stopping the conversion '66s' I would like to take the 's' off so I can convert.

dfWeather['HOURLYDRYBULBTEMPF'].replace("s+", "")
dfWeather['HOURLYDewPointTempF'].replace("s+", "")
dfWeather = dfWeather.astype({"HOURLYDRYBULBTEMPF": float, "HOURLYDewPointTempF": float})

When I run this code I get

ValueError: could not convert string to float: '66s

I would like to strip the 's' delete the 's' or even just replace the '66s' with a '66'

Jimmy_Jump
  • 17
  • 5

0 Answers0