pandas

In pandas, you can use the following command: 

 DallasData.groupby(['active_status','zip']).agg({'services_completed':np.sum,'days_old':np.mean}).head(5)

The following is the output to the preceding commands:

Multi-indexed grouping by customer active status and zip code using groupby in Python
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset