I have the following data frame:
Data Frame:
id animal
1  dog
2  cat
3  rabbit
4  horse
5  fox
I want to replicate each id 3 times. How can I do this in pandas using method chaining?
Expected output:
id animal
1  dog
1  dog
1  dog
2  cat
2  cat
2  cat
3  rabbit
3  rabbit
3  rabbit
4  horse
4  horse
4  horse
5  fox
5  fox
5  fox
 
     
    