0

I have this DF:

df = pd.DataFrame({"A":[1,2,3,4,5], "B":[100,200,300,400,500], "C":["Cat", "Dog","Cat","Cat","Dog"]})

I need a new column that is an integer value corresponding to the values in column "C". It would be 1,2,1,1,2.

    A   B       C       D
0   1   100     Cat     1
1   2   200     Dog     2
2   3   300     Cat     1
3   4   400     Cat     1
4   5   500     Dog     2
nicomp
  • 4,344
  • 4
  • 27
  • 60

0 Answers0