Python Forum
Converting text data into numeric to use SVM
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Converting text data into numeric to use SVM
#6
(Jan-18-2019, 07:18 AM)perfringo Wrote:
(Jan-17-2019, 06:33 PM)mukhan169 Wrote: I dont know enough python to convert my text data into int. If someone can guide me into right direction (tutorial, example) to convert the text data to int that will be greatly appreciated.

In Python you convert string to int with built-in function int().

Some examples:

>>> int('10')
10
>>> int('0010')
10
>>> int('1.0')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '1.0'
Yes I am but i want to use tf and itf. I cant hard code a number to a string as their will be over 100 k records. once i have converted string to tf and itf I should be able to use the SVM algorithm.
Does it make any more sense?
Reply


Messages In This Thread
RE: Converting text data into numeric to use SVM - by mukhan169 - Jan-22-2019, 01:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Convert dataframe string column to numeric in Python darpInd 1 2,416 Mar-14-2020, 10:07 AM
Last Post: ndc85430
  Handling escape charters while converting data frame to JSON RahulShukla 0 1,768 Nov-11-2019, 11:22 AM
Last Post: RahulShukla

Forum Jump:

User Panel Messages

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