In R, you can combine two dataframes by sticking the columns of one onto the bottom of the columns of the other using rbind. In pandas, how do you accomplish the same thing? It
pd.concat will serve the purpose of rbind in R.
import pandas as pd
df1 = pd.DataFrame({'col1': [1,2], 'col2':[3,4]})
df2 = pd.DataFrame({'col1': [5,6], 'col2':[7,8]})
print(df1)
print(df2)
print(pd.concat([df1, df2]))
The outcome will looks like:
col1 col2
0 1 3
1 2 4
col1 col2
0 5 7
1 6 8
col1 col2
0 1 3
1 2 4
0 5 7
1 6 8
If you read the documentation careful enough, it will also explain other operations like cbind, ..etc.