0

I know how to append rows, delete rows, concatenate data frames, but how do you do cut and insert rows in a dataframe without having to delete, splice, and concatenate? Is there a built-in method for this? Let's say I have a DataFrame:

Index A B
0 1 2
1 2 2
2 3 3
3 4 5
4 5 5

and I want to replace rows 1 & 2 with:

0 5 5
1 5 5
2 5 5

so I get:

Index A B
0 1 2
1 5 5
2 5 5
3 5 5
4 4 5
5 5 5
user1566200
  • 1,826
  • 4
  • 27
  • 47

0 Answers0