ICS 104: Introduction to Programming in Python & C (Term-201) Lab Project Data Analysis Lab Project Guidelines 1. The lab project will be done by teams of 2 students. 2. The lab project requires the...



















ICS 104: Introduction to Programming in Python & C (Term-201) Lab Project Data Analysis Lab Project Guidelines 1. The lab project will be done by teams of 2 students. 2. The lab project requires the following items: a) Comments must be included (5%). b) The code must use meaningful variable names and modular programming (10%). c) Global variables should be avoided as much as possible. Students should learn how to pass parameters to functions and return results. d) Students must submit a working program. Non-working parts can be submitted separately. If a team submits a non-working program, it loses a fraction of the grade (20%). e) User input must be validated by the program i.e. valid value. 3. The deadline for submitting the lab project is Friday December 4 before midnight. 4. Submitting Saturday before midnight will lead to penalty (5%). 5. Submitting Sunday before midnight will lead to a higher penalty (15%). 6. If plagiarism among teams is detected then the concerned teams will get 0. Lab Project Deliverable 1. Each team has to submit the following: a) The code as a Jupyter notebook. b) Documenting the code using comments as part of the Jupyter notebook. The comments will describe how they solved the problem and the different functions with their tasks (5%). 2. Lab demo/presentation a) The week of December 6 to 10 will be used for lab project presentations. b) A slot of 15 minutes will be allocated to each team for their presentation and questions. c) Students who do not appear for lab demo/presentation will get 0. 3. 20% of the grade are highlighted above. The remaining 80% will be on the code itself and presentation. Description of the Data Data for this project is available in a CSV file names “SalesRecords.csv”. It is defined in the following columns headers: RegionCountryItem TypeUnits SoldUnit PriceUnit Cost How to Read a CSV File import csv# To install csv module C:\> pip install csv-reader with open('filename.csv') as f: f.seek(0) # rewind csv_reader = csv.reader(f, delimiter=',') for row in csv_reader: print(row) # row is a list How to Manipulate a Python Dictionary d = {} # Initialize a new dictionary d d.update({key1:value1, key2:value2, key3:value3}) Must Use Python Constructs 1. Variables 2. Boolean operators 3. If-Statements 4. For Loops 5. While Loop 6. Functions 7. Lists 8. Tuples 9. Dictionaries (nested) 10. Files Project Output Write a Python program to extract the following information from the related csv file. 1. Display regions names. (8 points) 2. Select a region name and display countries in that region. (8 points) 3. Select a country from the selected region name and then display item types for that country. (8 points) 4. For each item type, display the following: a. Unit Sold (5 points) b. Unit Cost (5 points) c. Unit Price (5 points) d. Total Cost (# of Units Sold X # of Unit Cost) (6 points) e. Total Revenue (# of Units Sold X # of Unit Price) (6 points) f. Total Profit (Total Revenue - Total Cost) (6 points) g. Country revenue for all items (6 points) h. Countries where the selected item type is sold (7 points) 5. Presentation (10 points) Hints and Suggestions Region names: List [region 1, region 2, …, region n] Country names: List [country 1, country 2, …, country n] Region to Country Name: Dictionary {region: country name} Item Type, Unit sold, unit cost and unit price: Tuple (item type, unit sold, unit sold, unit price) Country items: Dictionary {country name: (item type, unit sold, unit sold, unit price)} All Countries Items: List [country name1, country name 2, … country name n] Page 3 of 3
Nov 12, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here