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 21, 2020 in Machine Learning by anonymous
• 120 points
650 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, 2020 by MD
• 95,460 points

Related Questions In Machine Learning

0 votes
1 answer
+1 vote
1 answer

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8nhf9w2t/grpcio/

Hi@akhtar, You may get this error because of ...READ MORE

answered May 16, 2020 in Machine Learning by MD
• 95,460 points
32,689 views
0 votes
1 answer

Example to run KNN algorithm using python

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

answered May 9, 2019 in Machine Learning by Harvy
1,567 views
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,391 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP