Python error invalid literal

0 votes

Hello,

I got an error "invalid literal for int() with base 10:" while creating a model for devanagri hindi handwriting dataset. View the following screenshot below.Please help me to resolve the error.

Thank You,

With Regards

Chandralekha

Jul 20 in Machine Learning by anonymous
• 120 points
49 views

1 answer to this question.

0 votes

Hi,

I think you are trying to convert your dataset into an integer. But before trying to convert a suspicious variable to an integer, first, check the type of variable.

For example you can see the below code.

>>> text = '101.10'
>>> int(text)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '101.10'
>>> 
>>> f = float(text)
>>> f
101.1
>>> int(f)
101
>>> 
answered Jul 21 by MD
• 56,140 points

Related Questions In Machine Learning

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer

Example to run KNN algorithm using python

Have a look at this one: from sklearn.datasets ...READ MORE

answered May 8, 2019 in Machine Learning by Harvy
461 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,352 views
0 votes
0 answers