Saa17
Saa17

Reputation: 265

Combining data frames with the same columns

I have a data frame that looks like this

A B C
1 4 7
2 5 8
3 6 9

And also another data frame that looks like this

A B C
2 1 7
4 3 9
6 5 8

How can I combine those two data frames to get a new data frame that looks like this

A B C
1 4 7
2 5 8
3 6 9
2 1 7
4 3 9
6 5 8

Basically, the two data frames have the same column names and number of columns. I just want to combine all of the rows. Would prefer using pandas to do this.

Upvotes: 0

Views: 33

Answers (1)

BENY
BENY

Reputation: 323236

Check with append

df1 = df1.append(df2)

Upvotes: 1

Related Questions