I have one column called "A" with only values 0 or 1. I have another column called "B". If column A value=0, I want the column B value to equal "dog". If column A value=1, I want the column B value to equal "cat".
Sample DataFrame column:
print(df)
   A
0  0
1  1
Is there anyway to fill the B column as such without a for loop?
Desired:
print(df)
   A  B
0  0  Cat
1  1  Dog
Thanks
 
     
    