Question: show python codes for 4 . 1 to 4 . 7 Consider the data provided in the streaming tutorial ( namely users.csv ) alongside orders

show python codes for 4.1 to 4.7
Consider the data provided in the streaming tutorial (namely users.csv) alongside orders data (namely orders.csv). Combine these 2 input files in order to provide insights into the purchasing behaviours of the retailers customers.
4.1) Join the input files as streams using CoGroupByKey. (1)
4.2) Perform a transformation that determines the average number of orders for female and male customers, respectively. Output the result as text in the notebook. (3)
4.3) Verify the result of Question 4.2 using Python Pandas. (1)
4.4) Duplicate the code of previous question (in a new cell) and split your pipe to produce/emit the total number or orders processed as an additional text output (i.e. output the number of orders processed as well the average orders for female and male customers).(2)
4.5) Generate a graph (using the Beam library) of your pipeline.
4.6) Determine the total number of orders placed by male and female customers in the age groups [18-27),[28-37),[37-46),[46-55).(3)
4.7) Modify the pipeline/directed-acyclic-graph (DAG) of Question 4.6 to display the total number of yams purchased across the genders within the [18-27),[28-37) age groups. (3)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!