0

I want to replicate a row N times in a dataframe that I know its index in advance.

For example:

    A   B   C
0   foo 2   3
1   foo 9   nan
2   foo 1   4
3   bar 90  1
4   boo 12  89

Let's say I want to replicate row number 3 three times as follows:

    A   B   C
0   foo 2   3
1   foo 9   nan
2   foo 1   4
3   bar 90  1
4   bar 90  1
5   bar 90  1
6   boo 12  89
Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
  • 1
    Voting to reopen, it is not trivial to get the desired output using the solutions in the linked duplicate – mozway Aug 01 '21 at 02:00

0 Answers0