Reputation: 11039
I have a pandas Series x
with values 1
, 2
or 3
.
I want it to have values monkey
, gorilla
, and tarzan
depending on the values.
I guess I should do something like
values = ['monkey', 'gorilla', 'tarzan']
x = values[x - 1]
but it doesn't work. I guess it's because it doesn't operate elementwisely.
Upvotes: 0
Views: 331