Day: March 23, 2022

Getting Revenue Details Per Order

Get revenue details per order¶ Create a function get_revenue_per_order which takes order_items list as argument and returns a dict which contain order_item_order_id and corresponding quantity as well as order_revenue. {note} This is an example to get order_id and corresponding quantity as well as revenue. For each order_id, quantity and revenue are treated as list. In [1]: …

Getting Revenue Details Per Order Read More »

Getting Order Count By Status

Get Order Count by Status¶ Create a function get_count_by_order_status which takes orders list as argument and returns a dict which contain order_status and corresponding count. In [2]: %run 07_preparing_data_sets.ipynb In [3]: orders[:10] Out[3]: [‘1,2013-07-25 00:00:00.0,11599,CLOSED’, ‘2,2013-07-25 00:00:00.0,256,PENDING_PAYMENT’, ‘3,2013-07-25 00:00:00.0,12111,COMPLETE’, ‘4,2013-07-25 00:00:00.0,8827,CLOSED’, ‘5,2013-07-25 00:00:00.0,11318,COMPLETE’, ‘6,2013-07-25 00:00:00.0,7130,COMPLETE’, ‘7,2013-07-25 00:00:00.0,4530,COMPLETE’, ‘8,2013-07-25 00:00:00.0,2911,PROCESSING’, ‘9,2013-07-25 00:00:00.0,5657,PENDING_PAYMENT’, ‘10,2013-07-25 00:00:00.0,5648,PENDING_PAYMENT’] In [4]: order = orders[0] …

Getting Order Count By Status Read More »

Overview of Grouped Aggregations

Overview of Grouped Aggregations¶ Here are some of the examples for grouped aggregations. Get number of employees for each department Get daily revenue for a given month (aggregation for a given day and filtering based up on month). Number of courses enrolled by each student Number of students enrolled for each course In [1]: %run 07_preparing_data_sets.ipynb …

Overview of Grouped Aggregations Read More »