IE5600 – Applied Programming for Industrial Systems
IE5600 – Applied Programming for Industrial Systems
AY 2023/24 Semester 1 Individual Assignment 1 - PyPivot
Objectives
At the completion of the individual assignment, you should:
-
Develop a better understanding of how to apply the computational problem solving process to a moderately complex problem.
-
Implement imperative and structured programming paradigms in Python.
-
Apply appropriate control flow statements to implement algorithm.
-
Apply appropriate multi-dimensional data structures to implement algorithm.
General Requirements
You are required to develop a Python program known as PyPivot to manage data in a two- dimensional dataset consisting of column header representing attribute name and row header representing record identifier. The program should then allow user to visualise the data in a pivot table. A pivot table is a table of grouped values that aggregates the individual data items in the original dataset within one or more discrete categories. Typical aggregate functions include count, sum, average, minimum and maximum.
Figure 1 shows a typical pivot table in Microsoft Excel. As shown in Figure 1, categorical attributes may be placed in a pivot table as columns, rows or a mixture of both. If there are more than one aggregated data items, they can be placed in the pivot table column-wise or row-wise as shown in Figure 2.
Figure 2 – Pivot table showing two aggregated data items column-wise (top) and row-wise (bottom). Use Cases
Implement the following use cases for PyPivot without the use of any Python modules. In other words, your program should NOT contain any import statement unless you are importing your own user-defined module(s).
S/N |
Use Case |
Use Case Description/Business Rules |
1 |
New Dataset (0 mark) |
|
2 Load Test Dataset •
Auto load the dataset shown in Figure 1.
This dataset can be downloaded from Canvas.
(0 mark)
•
3 |
Add Column (1 mark) |
|
S/N |
Use Case |
Use Case Description/Business Rules |
||||
4 |
Delete Column (1 mark) |
• Delete Gender |
||||
5 |
Add Row (1 mark) |
|
||||
6 |
Delete Row (1 mark) |
• Delete 1 |
S/N |
Use Case |
Use Case Description/Business Rules |
||||
7 |
View Pivot Table Fields (1 mark) |
o Rows – Categorical attributes designated as the row header. o Values – Data attributes that are aggregated from the original data values. The following aggregation functions should be supported: Count
|
||||
8 |
Add Pivot Table Field (1 mark) |
|
||||
9 |
Delete Pivot Table Field (1 mark) |
|
S/N |
Use Case |
Use Case Description/Business Rules |
||||
10 |
View Pivot Table (2 marks) |
|
||||
11 |
View Pivot Table with
Grouped Summary |
• Use Case 10 with the generation of row summary, column summary and overall summary for each value field. See Figure A.2 in Appendix: sum of salary for the row field(s), column field(s) and grand total. |
Deliverable Submission
The assignment deliverable to be submitted to the Canvas Assignments tool are to be placed in a single zip archive file with the following folders structure:
• source subfolder containing:
o All Python source files that constitute your program.
o The main source file containing the program entry point should be named as
pypivot.py, i.e., your program should be runnable with the command python pypivot.py
Upload this zip archive file to the designated Canvas Assignment: Assignments > Individual Assignment 1.
Your deliverables must be submitted latest by Sunday, 22 October 2023, 11:59 pm. No submission will be accepted for assessment after this date/time and you will be awarded 0 marks.
-- End of Assignment Specification --