so I have two data frames, and used .append()
method to merge them vertically.
However, I get an error of which I assume the cause is duplicate id's. Here is a sample of the data frames.
A B
1 a1 b1
2 a2 b2
3 a3 b3
4 a4 b4
A B
1 q1 w1
2 q2 w2
3 q3 w3
4 q4 w4
Now the merged data frame looks like this:
A B
1 a1 b1
2 a2 b2
3 a3 b3
4 a4 b4
1 q1 w1
2 q2 w2
3 q3 w3
4 q4 w4
Now, I'd like to change the id of each row. Would that be possible? Thanks.
question from:
https://stackoverflow.com/questions/65880933/is-there-a-way-to-change-id-of-data-frames-appended-in-pandas 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…