Python Forum
Error: ValueError: could not convert string to float: 'L200 1.6 D/C'
Poll: Since When Do you use Python?
You do not have permission to vote in this poll.
I am new on Python
100.00%
1 100.00%
More than 2 years
0%
0 0%
Total 1 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error: ValueError: could not convert string to float: 'L200 1.6 D/C'
#3
Sparkz_alot thanks for the correction. You right I was using the "'" to comment like VBA, but It has to be #. I fix it.

Posted the error code.

Thanks for your time

#Random Forest

rf=RandomForestClassifier(n_estimators=100)

rf.fit(x_train,y_train)
Traceback (most recent call last):

  File "<ipython-input-77-12afa76ba01c>", line 1, in <module>
    rf.fit(x_train,y_train)

  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\ensemble\forest.py", line 247, in fit
    X = check_array(X, accept_sparse="csc", dtype=DTYPE)

  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 433, in check_array
    array = np.array(array, dtype=dtype, order=order, copy=copy)

ValueError: could not convert string to float: 'YARIS SPORT'
Reply


Messages In This Thread
RE: Error: ValueError: could not convert string to float: 'L200 1.6 D/C' - by Jaarroy - Jan-18-2018, 02:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Sad ValueError: could not convert string to float badju 0 4,333 Jul-01-2021, 12:13 AM
Last Post: badju
  Indirectlty convert string to float in JSON file WBPYTHON 6 5,957 May-06-2020, 12:09 PM
Last Post: WBPYTHON
  ValueError: could not convert string to float RahulSingh 3 4,216 Apr-09-2020, 02:59 PM
Last Post: dinesh
  convert a list of string+bytes into a list of strings (python 3) pacscaloupsu 4 10,877 Mar-17-2020, 07:21 AM
Last Post: markfilan
  Convert dataframe string column to numeric in Python darpInd 1 2,310 Mar-14-2020, 10:07 AM
Last Post: ndc85430
  convert 'A B C' to numpy float matrix rezabma 4 2,563 Feb-27-2020, 09:48 AM
Last Post: rezabma
  ValueError: could not convert string to float: '4 AVENUE' Kudzo 4 5,952 Jan-26-2020, 10:47 PM
Last Post: Kudzo
  Convert 'object' to 'string' AdWill97 1 62,494 May-06-2019, 08:22 AM
Last Post: Yoriz
  ValueError: could not convert the string to float Grin 3 10,247 Jun-14-2018, 08:17 PM
Last Post: killerrex
  Problema with convert image to string karlo123 1 2,787 May-16-2018, 10:44 PM
Last Post: karlo123

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020