Skip to content Skip to sidebar Skip to footer

Valueerror: Could Not Convert String To Float - Without Positional Indication

For a current project, I am planning to run a scikit-learn Stochastic Graduent Booster algorithm over a CSV set that includes numerical data. When calling line sgbr.fit(X_train, y_

Solution 1:

I thing there are not direct function to get positional indication. you can try this to convert

   print (df)
       column
    0  01
    1  02
    2  03
    3  04
    4  05
    5  LS

print (pd.to_numeric(df.column.str, errors='coerce'))
0    1.0
1    2.0
2    3.0
3    4.0
4    5.0
5    NaN
Name: column, dtype: float64

Post a Comment for "Valueerror: Could Not Convert String To Float - Without Positional Indication"