Exercise 1: Advanced Employee Records Management (2points)
Here I have implemented an advanced employee records management system using Python data class
as requested by the professor. The program supports the following; adding, updating, and displaying employee information, and also supports the calculation of the average performance scores and identifying top performers which you can see below.
Code
Output
Employee Dataclass: This contains the following;
Defines an Employee
with name, id, salary, position
and scores performance
.
The average_score
is what helps to calculate the employee average score performance.
EmployeeRecords Class:
This manages a list of employees and provides methods they can add, display, update, identify top performers, and calculate average scores. In the code, other classes help to display all employees alongside their average scores performance display_employees
and a class that returns the average performance score for a specific employee calculate_average_scores
.
In the program, the top performers are;
Exercise 2: Comprehensive Student Grades Analysis (2points)
Here I have shared a program that uses NumPy structured arrays to store and analyze student grades as requested by the professor. The program also has functions that calculate averages, identify top students, analyze subject-wise performance, etc which you can see below.
Code:
Output
Structured Array: In the program the structured Array is defined as student_dtype
to include fields for student_id
, name
, and grades for each of the subjects; Mathematics, Science, English, and History.
Functions: This helps us to calculate each student's average grade by averaging the four subject grades which the class name is calculate_average_grade
and other classes that identify students with average grades above a specified threshold.
Exercise 3: Enhanced Inventory Management System (2points)
Here I have implemented an enhanced inventory management system using named tuple
which is a Python program to track products. In the program, there are functions to add products, update quantities, generate low stock alerts, etc which you can see below.
Code
Output
The program especially the code provided us with a comprehensive inventory management system that can be further expanded with additional functionalities like product removal or tracking product suppliers.
Exercise 4: Advanced Customer Orders Processing (2points)
Here I have created a program that uses NumPy structured arrays to process customer orders as requested by the professor. This program includes several functions for calculating order totals, identifying large orders, analyzing customer spending, and as well finding frequently ordered products as seen below.
The Order structured Array: We can define a structured Array order"type
, with a field for order_id
, customer_name
, product,
quantity,
order date, and
price_per_unit`.
frequently_ordered_together
function which uses counter
is been used.Exercise 5: In-Depth Weather Data Analysis (2points)
Here I have implemented an in-depth weather data analysis using dataclass
and NumPy. The program includes functionalities for calculating averages, identifying trends, and detecting anomalies in weather data which you can see below.
WeatherRecord
instances.convert_to_numpy
function then converts the list into a structured NumPy Array for efficient numerical operations.Functions:
The calculate_averages
computes average temperature, max humidity, total precipitation, and average wind speed using the function of NumPy.
identify_temperature_thresholds
: This finds days where temperatures are below or above specified thresholds.
detect_trends
: this makes use of np. Diff
to calculate the differences between consecutive values and detect the overall trend.
detect_anomalies
: this identified sudden drops or spikes in temperature using nipdiff
and a specified threshold.
I am inviting; @dove11, @simonmwigwe, and @ruthjoe
Cc:-
@kouba01