Combined Form pandas

Simple form vertically connected requirements consistent field, ignored index 

  A mode: res = df1.append ([df2, df3, df5], ignore_index = True)     

  Second way: res = pd.concat ([df1, df2, df3], axis = 0, ignore_index = True) 

About merger

  res = pd.concat([df1,df2,df3],axis=1,ignore_index=False) 

 

When a field is not the same column, we often use to join parameter,

join to each other will be cut off without lifting between data when the 'inner',

NaN values ​​will join with each other to fill the data when there is no 'outer'

  res = pd.concat([df1,df2,df3],join=‘inner’,ignore_index=True) 

Use join_axes parameters can be specified in the DataFrame index to merge

res = pd.concat([df4,df5],axis=1,join_axes=[df5.index])

Guess you like

Origin www.cnblogs.com/chenxiyuxiao/p/11323468.html