admin 管理员组

文章数量: 887021


2024年1月14日发(作者:easyui复选框多选)

series合并成dataframe_【S01E04】pandas之合并数据集

I. 数据库风格的合并——mergeMerge DataFrame objects by performing a database-style join operation bycolumns or (left, right, how='inner', on=None, left_on=None, right_on=None,

left_index=False, right_index=False, sort=False, suffixes=('_x', '_y'),

copy=True, indicator=False, validate=None)left : DataFrameright : DataFramehow : {'left', 'right', 'outer', 'inner'}, default 'inner' * left: use only keys from left frame, similar to a SQL left outer join; preserve key order * right: use only keys from right frame, similar to a SQL right outer join; preserve key order * outer: use union of keys from both frames, similar to a SQL full outer join; sort keys lexicographically * inner: use intersection of keys from both frames, similar to a SQL inner join; preserve the order of the left keyson : label or list Column or index level names to join on. These must be found in both DataFrames. If `on` is None and not merging on indexes then this defaults to the intersection of the columns in both _on : label or list, or array-like Column or index level names to join on in the left DataFrame. Can also be an array or list of arrays of the length of the left DataFrame. These arrays are treated as if they are _on : label or list, or array-like Column or index level names to join on in the right DataFrame. Can also be an array or list of arrays of the length of the right DataFrame. These arrays are treated as if they are _index : boolean, default False Use the index from the left DataFrame as the join key(s). If it is a MultiIndex, the number of keys in the other DataFrame (either the index or a number of columns) must match the number of levelsright_index : boolean, default False Use the index from the right DataFrame as the join key. Same caveats as left_indexsort : boolean, default False Sort the join keys lexicographically in the result DataFrame. If False, the order of the join keys depends on the join type (how keyword)suffixes : 2-length sequence (tuple, list, ...) Suffix to apply to overlapping column names in the left and right side, respectivelycopy : boolean, default True If False, do not copy data unnecessarily重点参数 left

right

how

II. 按索引合并——join


本文标签: 合并 复选框 重点