Question: I am trying to convert a an Arabic string to a float and i get this error could not convert string to float: this string

I am trying to convert a an Arabic string to a float and i get this error

"could not convert string to float:"

this string can be converted

while this string can't

i am trying to convert the string with glyphs and i don't know how to do that in python.

import pandas as pd from sklearn.tree import DecisionTreeClassifier

exData = pd.read_csv('One.csv',encoding = 'utf-8') x = exData.drop(columns=['first']) y = exData['second'] model = DecisionTreeClassifier() model.fit(x,y) exData

could not convert string to float: '   '

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!