Union in more than 2 pandas dataframe

前端 未结 3 1148
死守一世寂寞
死守一世寂寞 2021-02-20 04:38

I am trying to convert a sql query to python. The sql statement is as follows:

select * from table 1 
union
select * from table 2
union 
select * from table 3
un         


        
3条回答
  •  时光取名叫无心
    2021-02-20 04:56

    If I understand well the issue, you are looking for the concat function.

    pandas.concat([df1, df2, df3, df4]) should work correctly if the column names are the same for both dataframes.

提交回复
热议问题