Structured Data: polymerization, merging and remodeling Pandas

Structured Data: polymerizing combined and remodeling "Data analysis using pandas -e2"

Data may be spread across many files or databases, the storage form is not conducive to analysis.

This section concerns the polymerization can be combined, a method of remodeling data.

  • First, I will introduce a hierarchical index pandas, which are widely used in the above operations.
  • I then insight into some special data manipulation.
  • Finally, practical applications: In Chapter 14, you can see a variety of applications for these tools.

 

 

8.1 Hierarchical Index

Hierarchically ordered rearrangement

Depending on the level summary statistics

Use DataFrame column index

 

8.2 merge data sets

DataFrame consolidated database style

 

Merge on the index

 

Axial connection: connection (concatenation), binding (Binding) or stacked (stacking).

 

Merging overlapping data

 

8.3 remodeling and axial rotation

Remodeling index hierarchy

The "long form" rotate "wide format"

 

Guess you like

Origin www.cnblogs.com/chentianwei/p/12325465.html