SlideShare a Scribd company logo
1 of 13
Download to read offline
Question 1.
Import the csv file in pandas and save it as a dataframe. Then, write a code that returns: (1) the
first 10 and last 10 rows; and (2) the number of rows and columns in the data set. Discuss what
the code shows you about the data set.
Output :
Question 2.
Write a code that returns: (1) the distribution of sales outlets (including a count of each outlet
type and a bar chart); (2) the minimum and maximum transaction_id; (3) the minimum,
maximum and average customer_id; and (4) the distribution of products in bought in store (yes
or no) using a pie chart.
Code:
Output:
Question 3.
You discover that the variable unit_price was incorrectly recorded. Create a new variable
unit_price_corrected where you add 1.50 to unit_price for the first 100 items, and you subtract
1.50 from the unit price for the remaining items in the data set. Then, calculate and compare the
average of unit_price and unit_price_corrected.
Code:
Output:
Question 4.
The coffee shop’s management wants to find out which of the outlets has the highest revenue.
Calculate the total revenue for each of the outlets. Remember that total revenue will be
unit_price_corrected multiplied by quantity. Also, present your calculations using a line graph.
Explain what you found and what the chart shows.
Code:
Output:
Question 5.
The coffee shop’s management wants to find out how the staff are doing in terms of sales. For
each of the staff ids, calculate the total product units sold and the total revenue sold. Provide two
bar charts (one for total product units, one for total revenue) by staff id, and interpret your
Findings.
Code:
Output:
Question 6.
Develop one question yourself that can be answered with the information included in this
dataset. Write the code to answer the question, and include a visualization.
Question 7.
Develop one question yourself that can be answered with the information included in this
dataset. Write the code to answer the question, and include a visualization.
Part 2
You are hired to develop an online management system for a cafe. This program will be used by
the café admins and will help them manage online orders. Use a function to develop a program
with the following features:
1. Allow the café admin to enter the menu items until the user enters quit to stop. The list
should include a minimum of 10 items. For example: main_categories = [Americano,
Espresso, Cheese sandwich]
2. Use the main menu list you created in step 1 to create a dictionary that should contain the
price of each of the menu items with their respective cost. For example: items_price=
{“Americano”: 13, “Espresso”: 9, “Cheese sandwich”:15}
3. Use the main menu list you created in step 1 to create another dictionary that should
contain the quantity of each menu item. items_quantity={“Americano”: 50, “Esspresso”:
30, “Cheese sandwich”:10}
4. Use the main menu list you created in step 1 to create another dictionary that allows the
cafe admin to record the rating received from customers on menu items. The ratings are
scored on a scale from 1 to 5, with 5 indicating the maximum customer satisfaction. For
example: items_rating = {“Americano”: 4, “Esspresso”: 1, “Cheese sandwich”:5}
Your function should return the following data structures separately:
1. The dictionary that includes all entries.
2. A list named satisfied_item, which includes the items with satisfaction of 3 or higher.
3. A list named highprice_item, which includes the items with price above 10 .
4. A list named few_items, which includes the items with quantity less than 5.
Algorithm :
• To keep track of menu items and their pertinent details, initialize a
dictionary called menu_items, ensuring it starts with no entries.
• To keep track of items meeting satisfaction criteria of 3 or above, initialize
an empty list called satisfied_items.
• To keep track of pricey items, initiate an empty list with the name
highprice_items, and only store objects that surpass a cost of 10.
• To hold the items that have a quantity less than 5, it is necessary to make
an empty list named few_items.
• To give the café admin the ability to type in menu items, initiating a loop
may be necessary.
• Prompt the café admin for the menu item's name within the loop. If they
type in "quit," leave the loop.
• Enter and store the menu item price in a variable, prompting the café adm
• Store the quantity of a menu item entered by the café admin in a variable
through a prompt.
• Enter the café admin to rate their satisfaction with the menu item on a
scale of 1 to 5 and then save it in a variable.
• Include the satisfaction rating, quantity, and price of the menu item within
the menu_items dictionary as a key-value pair.
• Append the content to the satisfied_items list, given that the rating exceeds
3.
• The menu item should be added to the highprice_items list if it exceeds 10
in price.
• List the menu item on the few_items list if the amount is below 5.
• Enter "quit" to exit the process, and repeat steps 6-13 until then.
• List the satisfied_items, highprice_items, few_items, and the menu_items
dictionary.
Flow chart :
Code:
Output : Test Cases:
Test case 2 :

More Related Content

Similar to b5ce01fe4c47f602c663bd3452653bb2.pdf

Comp 220 ilab 3 of 7
Comp 220 ilab 3 of 7Comp 220 ilab 3 of 7
Comp 220 ilab 3 of 7
ashhadiqbal
 
On boarding presentation sg
On boarding presentation sgOn boarding presentation sg
On boarding presentation sg
nqt251091
 

Similar to b5ce01fe4c47f602c663bd3452653bb2.pdf (20)

Microsoft Office Excel 2003 Sorting And Filtering
Microsoft Office Excel 2003 Sorting And FilteringMicrosoft Office Excel 2003 Sorting And Filtering
Microsoft Office Excel 2003 Sorting And Filtering
 
amazon sellers training guide - beginners
amazon sellers training guide - beginners amazon sellers training guide - beginners
amazon sellers training guide - beginners
 
Onboarding presentation - Thailand
Onboarding presentation - ThailandOnboarding presentation - Thailand
Onboarding presentation - Thailand
 
Onboarding presentation - Malaysia
Onboarding presentation - MalaysiaOnboarding presentation - Malaysia
Onboarding presentation - Malaysia
 
Comp 220 i lab 3 bank account lab report and source code
Comp 220 i lab 3 bank account lab report and source codeComp 220 i lab 3 bank account lab report and source code
Comp 220 i lab 3 bank account lab report and source code
 
Easy Pivot Tutorial June 2020
Easy Pivot Tutorial June 2020Easy Pivot Tutorial June 2020
Easy Pivot Tutorial June 2020
 
Lazada Onboarding - Philippines
Lazada Onboarding - PhilippinesLazada Onboarding - Philippines
Lazada Onboarding - Philippines
 
Creating an Invoice in a Spreadsheet_Cosocius Proof of Concept
Creating an Invoice in a Spreadsheet_Cosocius Proof of ConceptCreating an Invoice in a Spreadsheet_Cosocius Proof of Concept
Creating an Invoice in a Spreadsheet_Cosocius Proof of Concept
 
Sc training 1 managing products.
Sc training 1 managing products.Sc training 1 managing products.
Sc training 1 managing products.
 
Comp 220 ilab 3 of 7
Comp 220 ilab 3 of 7Comp 220 ilab 3 of 7
Comp 220 ilab 3 of 7
 
Faab Multi Channel Marketplace System - 1st Steps
Faab Multi Channel Marketplace System - 1st StepsFaab Multi Channel Marketplace System - 1st Steps
Faab Multi Channel Marketplace System - 1st Steps
 
Onboarding presentation - HK
Onboarding presentation - HKOnboarding presentation - HK
Onboarding presentation - HK
 
Coupons Auto-Apply ecosystem dashboard
Coupons Auto-Apply ecosystem dashboardCoupons Auto-Apply ecosystem dashboard
Coupons Auto-Apply ecosystem dashboard
 
Onboarding presentation - Indonesia
Onboarding presentation - IndonesiaOnboarding presentation - Indonesia
Onboarding presentation - Indonesia
 
On boarding presentation sg
On boarding presentation sgOn boarding presentation sg
On boarding presentation sg
 
Advanced Filter Concepts in MS-Excel
Advanced Filter Concepts in MS-ExcelAdvanced Filter Concepts in MS-Excel
Advanced Filter Concepts in MS-Excel
 
Catalogue management for Paytm Mall Shop
Catalogue management for Paytm Mall ShopCatalogue management for Paytm Mall Shop
Catalogue management for Paytm Mall Shop
 
Catalogue management for Paytm Mall shop
Catalogue management for Paytm Mall shopCatalogue management for Paytm Mall shop
Catalogue management for Paytm Mall shop
 
Catalogue management for Paytm Mall Shop
Catalogue management for Paytm Mall ShopCatalogue management for Paytm Mall Shop
Catalogue management for Paytm Mall Shop
 
How to set a compare at price for a product on shopify in 5 easy steps
How to set a compare at price for a product on shopify in 5 easy stepsHow to set a compare at price for a product on shopify in 5 easy steps
How to set a compare at price for a product on shopify in 5 easy steps
 

Recently uploaded

一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
awasv46j
 
Abortion pills in Kuwait 🚚+966505195917 but home delivery available in Kuwait...
Abortion pills in Kuwait 🚚+966505195917 but home delivery available in Kuwait...Abortion pills in Kuwait 🚚+966505195917 but home delivery available in Kuwait...
Abortion pills in Kuwait 🚚+966505195917 but home delivery available in Kuwait...
drmarathore
 
Design-System - FinTech - Isadora Agency
Design-System - FinTech - Isadora AgencyDesign-System - FinTech - Isadora Agency
Design-System - FinTech - Isadora Agency
Isadora Agency
 
How to Build a Simple Shopify Website
How to Build a Simple Shopify WebsiteHow to Build a Simple Shopify Website
How to Build a Simple Shopify Website
mark11275
 
Resume all my skills and educations and achievement
Resume all my skills and educations and  achievement Resume all my skills and educations and  achievement
Resume all my skills and educations and achievement
210303105569
 
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
wpkuukw
 
如何办理(UoB毕业证书)伯明翰大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UoB毕业证书)伯明翰大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UoB毕业证书)伯明翰大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UoB毕业证书)伯明翰大学毕业证成绩单本科硕士学位证留信学历认证
ugzga
 
Jual Obat Aborsi Semarang ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Semarang ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Semarang ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Semarang ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
422368378-Laos-Architecture.pdfmmmmkkkkmmm
422368378-Laos-Architecture.pdfmmmmkkkkmmm422368378-Laos-Architecture.pdfmmmmkkkkmmm
422368378-Laos-Architecture.pdfmmmmkkkkmmm
KarenNares2
 
定(购)莫纳什大学毕业证(Monash毕业证)成绩单学位证专业定制
定(购)莫纳什大学毕业证(Monash毕业证)成绩单学位证专业定制定(购)莫纳什大学毕业证(Monash毕业证)成绩单学位证专业定制
定(购)莫纳什大学毕业证(Monash毕业证)成绩单学位证专业定制
eqaqen
 
一比一定(购)滑铁卢大学毕业证(UW毕业证)成绩单学位证
一比一定(购)滑铁卢大学毕业证(UW毕业证)成绩单学位证一比一定(购)滑铁卢大学毕业证(UW毕业证)成绩单学位证
一比一定(购)滑铁卢大学毕业证(UW毕业证)成绩单学位证
wpkuukw
 
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
eqaqen
 

Recently uploaded (20)

一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
 
Spring Summer 2026 Inspirations trend book Peclers Paris
Spring Summer 2026 Inspirations trend book Peclers ParisSpring Summer 2026 Inspirations trend book Peclers Paris
Spring Summer 2026 Inspirations trend book Peclers Paris
 
Furniture & Joinery Details_Designs.pptx
Furniture & Joinery Details_Designs.pptxFurniture & Joinery Details_Designs.pptx
Furniture & Joinery Details_Designs.pptx
 
TRose UXPA Experience Design Concord .pptx
TRose UXPA Experience Design Concord .pptxTRose UXPA Experience Design Concord .pptx
TRose UXPA Experience Design Concord .pptx
 
Abortion pills in Kuwait 🚚+966505195917 but home delivery available in Kuwait...
Abortion pills in Kuwait 🚚+966505195917 but home delivery available in Kuwait...Abortion pills in Kuwait 🚚+966505195917 but home delivery available in Kuwait...
Abortion pills in Kuwait 🚚+966505195917 but home delivery available in Kuwait...
 
Gamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad IbrahimGamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad Ibrahim
 
Design-System - FinTech - Isadora Agency
Design-System - FinTech - Isadora AgencyDesign-System - FinTech - Isadora Agency
Design-System - FinTech - Isadora Agency
 
Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...
 
How to Build a Simple Shopify Website
How to Build a Simple Shopify WebsiteHow to Build a Simple Shopify Website
How to Build a Simple Shopify Website
 
Resume all my skills and educations and achievement
Resume all my skills and educations and  achievement Resume all my skills and educations and  achievement
Resume all my skills and educations and achievement
 
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
 
如何办理(UoB毕业证书)伯明翰大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UoB毕业证书)伯明翰大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UoB毕业证书)伯明翰大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UoB毕业证书)伯明翰大学毕业证成绩单本科硕士学位证留信学历认证
 
Jual Obat Aborsi Semarang ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Semarang ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Semarang ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Semarang ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
422368378-Laos-Architecture.pdfmmmmkkkkmmm
422368378-Laos-Architecture.pdfmmmmkkkkmmm422368378-Laos-Architecture.pdfmmmmkkkkmmm
422368378-Laos-Architecture.pdfmmmmkkkkmmm
 
定(购)莫纳什大学毕业证(Monash毕业证)成绩单学位证专业定制
定(购)莫纳什大学毕业证(Monash毕业证)成绩单学位证专业定制定(购)莫纳什大学毕业证(Monash毕业证)成绩单学位证专业定制
定(购)莫纳什大学毕业证(Monash毕业证)成绩单学位证专业定制
 
一比一定(购)滑铁卢大学毕业证(UW毕业证)成绩单学位证
一比一定(购)滑铁卢大学毕业证(UW毕业证)成绩单学位证一比一定(购)滑铁卢大学毕业证(UW毕业证)成绩单学位证
一比一定(购)滑铁卢大学毕业证(UW毕业证)成绩单学位证
 
Redefining Affordable Housing in Gurgaon The Role of Housing Architects from ...
Redefining Affordable Housing in Gurgaon The Role of Housing Architects from ...Redefining Affordable Housing in Gurgaon The Role of Housing Architects from ...
Redefining Affordable Housing in Gurgaon The Role of Housing Architects from ...
 
Essential UI/UX Design Principles: A Comprehensive Guide
Essential UI/UX Design Principles: A Comprehensive GuideEssential UI/UX Design Principles: A Comprehensive Guide
Essential UI/UX Design Principles: A Comprehensive Guide
 
Spring Summer 26 Colors Trend Book Peclers Paris
Spring Summer 26 Colors Trend Book Peclers ParisSpring Summer 26 Colors Trend Book Peclers Paris
Spring Summer 26 Colors Trend Book Peclers Paris
 
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
 

b5ce01fe4c47f602c663bd3452653bb2.pdf

  • 1. Question 1. Import the csv file in pandas and save it as a dataframe. Then, write a code that returns: (1) the first 10 and last 10 rows; and (2) the number of rows and columns in the data set. Discuss what the code shows you about the data set. Output :
  • 2. Question 2. Write a code that returns: (1) the distribution of sales outlets (including a count of each outlet type and a bar chart); (2) the minimum and maximum transaction_id; (3) the minimum, maximum and average customer_id; and (4) the distribution of products in bought in store (yes or no) using a pie chart. Code: Output:
  • 3. Question 3. You discover that the variable unit_price was incorrectly recorded. Create a new variable unit_price_corrected where you add 1.50 to unit_price for the first 100 items, and you subtract 1.50 from the unit price for the remaining items in the data set. Then, calculate and compare the average of unit_price and unit_price_corrected. Code: Output:
  • 4. Question 4. The coffee shop’s management wants to find out which of the outlets has the highest revenue. Calculate the total revenue for each of the outlets. Remember that total revenue will be unit_price_corrected multiplied by quantity. Also, present your calculations using a line graph. Explain what you found and what the chart shows. Code: Output:
  • 5. Question 5. The coffee shop’s management wants to find out how the staff are doing in terms of sales. For each of the staff ids, calculate the total product units sold and the total revenue sold. Provide two bar charts (one for total product units, one for total revenue) by staff id, and interpret your Findings. Code: Output:
  • 6. Question 6. Develop one question yourself that can be answered with the information included in this dataset. Write the code to answer the question, and include a visualization.
  • 7. Question 7. Develop one question yourself that can be answered with the information included in this dataset. Write the code to answer the question, and include a visualization.
  • 8. Part 2 You are hired to develop an online management system for a cafe. This program will be used by the café admins and will help them manage online orders. Use a function to develop a program with the following features: 1. Allow the café admin to enter the menu items until the user enters quit to stop. The list should include a minimum of 10 items. For example: main_categories = [Americano, Espresso, Cheese sandwich] 2. Use the main menu list you created in step 1 to create a dictionary that should contain the price of each of the menu items with their respective cost. For example: items_price= {“Americano”: 13, “Espresso”: 9, “Cheese sandwich”:15} 3. Use the main menu list you created in step 1 to create another dictionary that should contain the quantity of each menu item. items_quantity={“Americano”: 50, “Esspresso”: 30, “Cheese sandwich”:10} 4. Use the main menu list you created in step 1 to create another dictionary that allows the cafe admin to record the rating received from customers on menu items. The ratings are scored on a scale from 1 to 5, with 5 indicating the maximum customer satisfaction. For example: items_rating = {“Americano”: 4, “Esspresso”: 1, “Cheese sandwich”:5} Your function should return the following data structures separately: 1. The dictionary that includes all entries. 2. A list named satisfied_item, which includes the items with satisfaction of 3 or higher. 3. A list named highprice_item, which includes the items with price above 10 . 4. A list named few_items, which includes the items with quantity less than 5.
  • 9. Algorithm : • To keep track of menu items and their pertinent details, initialize a dictionary called menu_items, ensuring it starts with no entries. • To keep track of items meeting satisfaction criteria of 3 or above, initialize an empty list called satisfied_items. • To keep track of pricey items, initiate an empty list with the name highprice_items, and only store objects that surpass a cost of 10. • To hold the items that have a quantity less than 5, it is necessary to make an empty list named few_items. • To give the café admin the ability to type in menu items, initiating a loop may be necessary. • Prompt the café admin for the menu item's name within the loop. If they type in "quit," leave the loop. • Enter and store the menu item price in a variable, prompting the café adm • Store the quantity of a menu item entered by the café admin in a variable through a prompt. • Enter the café admin to rate their satisfaction with the menu item on a scale of 1 to 5 and then save it in a variable. • Include the satisfaction rating, quantity, and price of the menu item within the menu_items dictionary as a key-value pair. • Append the content to the satisfied_items list, given that the rating exceeds 3. • The menu item should be added to the highprice_items list if it exceeds 10 in price. • List the menu item on the few_items list if the amount is below 5. • Enter "quit" to exit the process, and repeat steps 6-13 until then. • List the satisfied_items, highprice_items, few_items, and the menu_items dictionary.
  • 11. Code:
  • 12. Output : Test Cases: