Home > other >  How to fix this error:- Unable to convert string ACTL6AS5 to float error in python
How to fix this error:- Unable to convert string ACTL6AS5 to float error in python

Time:12-15

I am looking for support and advice on how to fix this error:- "couldn't convert string ACTL6AS5 to float" in python. Please give me a solution with example as I am new to python programming.

Error after running the code will be added here soon! enter code here

Thank you in advance.

CodePudding user response:

Your question is a little incomplete... if you take some input from the user and then convert it to string then probably the user input is not convertible like if you are trying to convert 'a' into float which can cause an error like this...

try:
    miles = float(input("How many distance you traveled"))
except:
    print("Please type in a number!")

this is called error handling user inputs something that is not convertible into float it'll tell the user to input a right value

CodePudding user response:

I have tried the try and expect example but no luck because my original dataset and balanced dataset have 'strings' as features in python.

Is there any other way to solve this error?

Thanks

  • Related