Day: April 12, 2021

Pandas Example – Write a Pandas program to split the following dataframe into groups and calculate monthly purchase amount

(Python Example for Beginners)   Write a Pandas program to split the following dataframe into groups and calculate monthly purchase amount.   Test Data: ord_no purch_amt ord_date customer_id salesman_id 0 70001 150.50 05-10-2012 3001 5002 1 70009 270.65 09-10-2012 3001 5005 2 70002 65.26 05-10-2012 3005 5001 3 70004 110.50 08-17-2012 3001 5003 4 70007 …

Pandas Example – Write a Pandas program to split a dataset to group by two columns and then sort the aggregated results within the groups

(Python Example for Beginners)   Write a Pandas program to split a dataset to group by two columns and then sort the aggregated results within the groups. In the following dataset group on ‘customer_id’, ‘salesman_id’ and then sort sum of purch_amt within the groups Test Data: ord_no purch_amt ord_date customer_id salesman_id 0 70001 150.50 2012-10-05 …

Pandas Example – Write a Pandas program to split a dataset, group by one column and get mean, min, and max values by group. Using the following dataset find the mean, min, and max values of purchase amount (purch_amt) group by customer id

(Python Example for Beginners)   Write a Pandas program to split a dataset, group by one column and get mean, min, and max values by group. Using the following dataset find the mean, min, and max values of purchase amount (purch_amt) group by customer id (customer_id). Test Data: ord_no purch_amt ord_date customer_id salesman_id 0 70001 …

Pandas Example – Write a Pandas program to split the following given dataframe into groups based on school code and call a specific group with the name of the group

(Python Example for Beginners)   Write a Pandas program to split the following given dataframe into groups based on school code and call a specific group with the name of the group.   Test Data: school class name date_Of_Birth age height weight address S1 s001 V Alberto Franco 15/05/2002 12 173 35 street1 S2 s002 …

Pandas Example – Write a Pandas program to split the following given dataframe into groups based on school code and call a specific group with the name of the group

(Python Example for Beginners)   Write a Pandas program to split the following given dataframe into groups based on school code and call a specific group with the name of the group.   Test Data: school class name date_Of_Birth age height weight address S1 s001 V Alberto Franco 15/05/2002 12 173 35 street1 S2 s002 …

Pandas Example – Write a Pandas program to split the following given dataframe into groups based on single column and multiple columns. Find the size of the grouped data

(Python Example for Beginners)   Write a Pandas program to split the following given dataframe into groups based on single column and multiple columns. Find the size of the grouped data.   Test Data: school class name date_Of_Birth age height weight address S1 s001 V Alberto Franco 15/05/2002 12 173 35 street1 S2 s002 V …

Pandas Example – Write a Pandas program to split the following given dataframe into groups based on school code and class

(Python Example for Beginners)   Write a Pandas program to split the following given dataframe into groups based on school code and class.   Test Data: school class name date_Of_Birth age height weight address S1 s001 V Alberto Franco 15/05/2002 12 173 35 street1 S2 s002 V Gino Mcneill 17/05/2002 12 192 32 street2 S3 …

Pandas Example – Write a Pandas program to split the following dataframe by school code and get mean, min, and max value of age for each school

(Python Example for Beginners)   Write a Pandas program to split the following dataframe by school code and get mean, min, and max value of age for each school.   Test Data: school class name date_Of_Birth age height weight address S1 s001 V Alberto Franco 15/05/2002 12 173 35 street1 S2 s002 V Gino Mcneill …

Pandas Example – Write a Pandas program to split the following dataframe into groups based on school code

(Python Example for Beginners)   Write a Pandas program to split the following dataframe into groups based on school code. Also check the type of GroupBy object.   Test Data: school class name date_Of_Birth age height weight address S1 s001 V Alberto Franco 15/05/2002 12 173 35 street1 S2 s002 V Gino Mcneill 17/05/2002 12 …

Pandas Example – Write a Pandas program to merge two given dataframes with different columns

(Python Example for Beginners)   Write a Pandas program to merge two given dataframes with different columns.   Test Data: data1: key1 key2 P Q 0 K0 K0 P0 Q0 1 K0 K1 P1 Q1 2 K1 K0 P2 Q2 3 K2 K1 P3 Q3 data2: key1 key2 R S 0 K0 K0 R0 S0 …