【Pandas】Merge function

The Merge function is used to join the rows of two datasets by one or more keys, similar to a JOIN in SQL. The main usage scenario is the join table query.

Double table join query:

table1.merge(table2,on='index_x',now='left')

Left can write right, inner, outer, similar to SQL left join, right join, inner join, outer join


Multiple tables:

pd.concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False,
          keys=None, levels=None, names=None, verify_integrity=False,
          copy=True)

objs: Sequence, dataframe or panel objects to use for join queries.

axis: axis (horizontal and vertical axis)

join: inter takes the intersection, outer takes the union

...





Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324476013&siteId=291194637