I'm working on a data table and I need to create a new column based on which of the classes the value of another column falls in.
This is the original table:
ID sequence
AJ8 2
FT7 3
JU4 5
ER2 3
LI5 2
FR2 7
WS1 8
UG4 9
The ranges are 2, 3, 4, 6: first; 1,5,0: second; and 7,8, 9: third.
I created the variables
first = ['2', '3', '4', '6']
second = ['1', '5', '0']
third = ['7', '8', '9']
I want to get the following table
ID sequence code
AJ8 2 FIRST
FT7 3 FIRST
JU4 5 SECOND
ER2 3 FIRST
LI5 2 FIRST
FR2 7 THIRD
WS1 8 THIRD
UG4 9 THIRD
How do I do this?