You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A warehouse manager needs to identify critical inventory issues. Products are critical when their current stock has fallen below the reorder threshold and they haven't been restocked in over 30 days. These items need immediate attention.
540
+
541
+
**Task:**
542
+
543
+
Write a function `critical_inventory(filename)` that identifies which products are in critical status and returns the total number of products tracked, how many are critical, and which specific products need immediate restocking
544
+
545
+
**Parameters:**
546
+
-`filename` (str): Path to inventory CSV file
547
+
548
+
**Returns:**
549
+
- Dictionary with keys:
550
+
-`"total_products"` (int): Total number of products
551
+
-`"critical_count"` (int): Number of critical items
552
+
-`"critical_products"` (set): Set of critical product names
The HR department is preparing for the annual promotion cycle. To be considered for promotion, employees must have both strong performance (above company average) and sufficient experience (at least 2 years with the company). HR needs to know who qualifies.
574
+
575
+
**Task:**
576
+
577
+
Write a function `promotion_candidates(filename)` that determines which employees meet the promotion criteria and returns the company's average performance score, the experience requirement, how many employees qualify, and their names
578
+
579
+
**Parameters:**
580
+
-`filename` (str): Path to employee CSV file
581
+
582
+
**Returns:**
583
+
- Dictionary with keys:
584
+
-`"average_performance"` (float): Company average performance (rounded to 1 decimal)
585
+
-`"min_years_required"` (int): Minimum years required (always 2)
586
+
-`"candidate_count"` (int): Number of qualified candidates
587
+
-`"candidate_names"` (set): Set of candidate names
588
+
589
+
**Example:**
590
+
```python
591
+
result = promotion_candidates("data/employees.csv")
## Exercise 8: Maximum Scores by Subject <Badgetype="warning"text="Task" />
604
+
605
+
Navigate to `/labs/lab09/exercise8/exercise8.py`.
606
+
607
+
**Background:**
608
+
609
+
A school administrator wants to visualize the highest achievement in each subject (Math, Science, English, Physics, Chemistry) to understand which subjects have the strongest top performers. This will help identify where advanced programs are most successful.
610
+
611
+
**Task:**
612
+
613
+
Write a function `plot_subject_maximums(filename)` that creates a line chart showing the peak performance in each subject. The chart should display subjects on the horizontal axis and their maximum scores on the vertical axis, with points marked on the line. Return the total number of students analyzed
# Chart window appears showing line plot of maximum scores
619
+
print(count) # 25
620
+
```
621
+
622
+
**Chart Requirements:**
623
+
- x-axis label: "Subject"
624
+
- y-axis label: "Maximum Score"
625
+
- Title: "Maximum Scores by Subject"
626
+
- Use `marker='o'` to show points on line
627
+
628
+
---
629
+
630
+
## Exercise 9: Subject Distribution Comparison <Badgetype="warning"text="Task" />
631
+
632
+
Navigate to `/labs/lab09/exercise9/exercise9.py`.
633
+
634
+
**Background:**
635
+
636
+
The curriculum committee wants to compare how scores are spread across Math, Science, and English. By visualizing all three distributions on the same chart, they can identify which subjects show consistent performance versus which have wide variation in student achievement.
637
+
638
+
**Task:**
639
+
640
+
Write a function `compare_subject_distributions(filename)` that creates a histogram showing the score distribution for all three subjects on one chart. Make the distributions transparent so they can be compared visually, and include a legend to identify each subject. Return the total number of students analyzed
0 commit comments