The data processing operation pandas --- Polymerization [DESCRIBE] Sort [Take] Polymerization data classification [Series.groupby] Advanced Data Aggregation [DataFrame.groupby]

4. Polymerization operations on the data and outlier detection filter

4.1: DESCRIBE
A. using the function: DataFrame.describe (Self, percentiles = None, the include = None, the exclude = None)
B. parameter analysis:
Here Insert Picture Description
C. combat:
a C1. Official example
C2.
Here Insert Picture Description
E. exercise bar

5. Sort

A. Use functions: DataFrame.take (self, index, axis = 0, is_copy = True, ** kwargs) back to the axial position of elements in a given index.
----- Take () function accepts a list of index, numerical
----- EG: df.take ([1,3,4,2,5])
----- means can np.random .permutation () function randomly ordered
B. analytical parameters:
Here Insert Picture Description
C. combat:
C1. official Links
C2.
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
C3 random sequencing, sampling.
Here Insert Picture Description
E. practice section

5. Data Category / Group polymerization advanced data processing groupby

A. Use functions: Series.groupby (self, by = None , axis = 0, level = None, as_index = True, sort = True, group_keys = True, squeeze = False, observed False, ** kwargs)
B. analytical parameters:
Here Insert Picture Description
C. examples:
. a C1 official example
. C2
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
D. section
data aggregation is the final step of data processing, usually to make each array to generate a single value.
Data sorting process:
----- packet: first data are divided into groups
----- with function processing: Data for different applications different sets of functions to convert data
----- combined: different groups to give the the result of merging together
the core of the data classification process:
----- GroupBy () function
----- groups view the properties of grouping
E. practice section

6. Advanced Data Aggregation

A. Use functions: DataFrame.groupby (self, by = None , axis = 0, level = None, as_index = True, sort = True, group_keys = True, squeeze = False, observed False, ** kwargs)
B. analytical parameters:
Here Insert Picture Description
C. Description:
use after groupby packet transform may be used to provide custom functions and apply achieve more computing
---- df.groupby ( 'item') [ 'price'] sum () and df. .groupby ( 'item') [ ' price']. apply (sum) almost
---- will apply transform and calculates, in passed into the function to apply the transform or
---- apply transform and can also pass a lambda expression
D. actual examples:
. Dl Baidu with an advanced data aggregation related articles, this put it easy viewing
D2 of.
data.groupby ( 'item') [ '. price'] Apply (SUM).
according to item packet , take the price column, the price of each seeking SUM
Here Insert Picture Description
Apply
Here Insert Picture Description
Transform
Here Insert Picture Description
** Transform index match column will automatically return value, not heavy; Apply return a value based grouping, de-duplication.

Editor send: learning content from data compilation;
articles for the white may also be seen by the older generation industry, in order to avoid misleading knowledge, the article if there is an error, please crossings friend pointed out, the end to learn promptly corrected, see the comments section -

Published 73 original articles · won praise 24 · views 2566

Guess you like

Origin blog.csdn.net/weixin_44943394/article/details/103930305