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
#5
The solution is to use a dictionary
table = {
    "Customer complaint noise replace the ball joint": 42,
    "clutch repair": 43,
}

data = 'clutch repair'
print(table[data]) # prints 43
Reply


Messages In This Thread
RE: Converting text data into numeric to use SVM - by Gribouillis - Jan-18-2019, 07:03 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