Skip to content Skip to sidebar Skip to footer

Typeerror: Expected Binary Or Unicode String, Got 618.0

I've been trying to implement this ML Linear Model into my dataset. (https://www.tensorflow.org/tutorials/estimator/linear) Language: Python 3.8.3 Lİbraries: TensorFlow 2.4.0 N

Solution 1:

MY guess is that you have some non-unicode characters in your data. Non unicode characters are like this: � ä

anything that is not a letter, number or symbol. you have two options here, to find all these characters and replace them with something else or remove them.

Or you can use a proper encoding when reading the csv file. pandas.read_csv

data = pandas.read_csv(myfile, encoding='utf-8', quotechar='"', delimiter=',') 

Solution 2:

I can't see your data so this is a guess. Open your .csv file and search for 618.0. Perhaps, some lines don't have all the expected values and the parser is trying to load a numerical value where a categorical one is expected. Another way to see if you have "format" issues is by opening your csv in excel and see if all lines are properly formatted.

Post a Comment for "Typeerror: Expected Binary Or Unicode String, Got 618.0"