Python Forum
change numerical values to categorical names
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
change numerical values to categorical names
#1
I am trying to convert numerical data points to categorical names in output. I want it to be labelled as categorical name but I need the raw data to stay numeric for functions elsewhere in the code. I have done this in anothe language (SAS) but I'm having trouble in python. I have found some code to clean up numbers (posted below). I do not get any errrors but it also does not change the output. Note. Please advise.

cleanup_nums = {"Congruency":     {1: 'Congruent', 2:'Incongruent'},
                "CueState": {1:'No Cue', 2: 'Center Cue', 3:'Spatial Cue' }}
Reply


Messages In This Thread
change numerical values to categorical names - by JoeOpdenaker - Oct-24-2020, 07:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  output values change akbarza 3 539 Oct-18-2023, 12:30 PM
Last Post: deanhystad
  Print names in x-axis of a time-series values hobbyist 4 1,245 Apr-22-2023, 09:29 PM
Last Post: deanhystad
  restrict user input to numerical values MCL169 2 929 Apr-08-2023, 05:40 PM
Last Post: MCL169
Question Inserting Numerical Value to the Element in Optionlist and Printing it into Entry drbilgehanbakirhan 1 821 Jan-30-2023, 05:16 AM
Last Post: deanhystad
  Changing a string value to a numerical value using python code and a lamda function Led_Zeppelin 6 1,631 Jul-05-2022, 11:29 PM
Last Post: deanhystad
  Sorting numerical values provided by QAbstractTableModel BigMan 0 1,375 Jun-04-2022, 12:32 AM
Last Post: BigMan
  How to plot 3D graph of non numerical value? Gevni 0 2,231 Mar-05-2021, 02:50 PM
Last Post: Gevni
  Filtering Excel Document Data Based On Numerical Values eddywinch82 30 10,799 Feb-25-2020, 06:08 PM
Last Post: eddywinch82
  Using groupby on non-categorical values namy77 1 1,725 Feb-04-2020, 11:58 PM
Last Post: scidam
  'Age' categorical (years -months -days ) to numeric Smiling29 4 2,950 Oct-17-2019, 05:26 PM
Last Post: Smiling29

Forum Jump:

User Panel Messages

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