The collected data is usually divided into multiple files or databases after storage. How to splice these files as needed or connect them by key is very important. This section will introduce the complex operations of data indexing such as hierarchical index, stack, unstack, seet_index, reset_index, etc. to help reconstruct data, data splicing such as merge, join, concat, combine_first, etc. to help connect data, as well as the use of pivot tables.
Table of contents
- Combining and merging data
-
- 1. pd.merge() pd.join() uses keys to join data
-
- 1.1 Synthesize data based on the columns (keys) of Df
- 1.2 Synthesize data based on the index column of Df
- 1.3 Synthetic set selection method (how parameter)
- 1.4 Columns that are not used as keys but have the same column name during synthesis (suffixes parameter)
- 1.5 Summary of pd.merge parameters (other parameters)
- 1.6 Use pd.join to simplify merging by index column
- 2. pd.concat() concatenates data according to the axis direction