I have a dataset that looks like this
and the datatypes looks like this
I am attempting the change the datatype of cubicinches and weightlbs into float or integer but none of the options is working:
df["cubicinches"]=df["cubicinches"].astype(float)
df = df.astype({"weightlbs": float, "cubicinches": float})
df['weightlbs'] = pd.to_numeric(df['weightlbs'])
There could be an entry in one of the mentioned columns that is an actual string with letters or so. To check, you can get the unique values for each column to try to find it.
e.g.