Course Content
Pandas: First Steps
Pandas: First Steps
Introduction to PandasSeriesTask: Coffee Orders SeriesTask: Barista's Favorites CoffeesAccessing Elements from a SeriesTask: Drink of the HourTask - Signature DrinksTask: Mid-Morning SpecialsTask - Fetching the Mid-Shift DrinksOperations over SeriesTask: Modifying a single elementTask: Modifying the Entire SeriesTask: Modifying Part of a SeriesTask: Processing the Restock of Inventory
Task: Processing the Restock of Inventory
Task
Swipe to start coding
The team at CafΓ© Pandasia has completed a fresh restock of coffee beans! Youβve been given two Series:
previous_inventory
: The original stock before the deliveryrestocked
: The number of units added during the restock
Youβve been asked to calculate the total updated inventory by adding the two Series together.
- Add the corresponding elements of
previous_inventory
andrestocked
Series to calculate the total current inventory. - Save the result in a new variable called
updated_inventory
.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 14
Task: Processing the Restock of Inventory
Task
Swipe to start coding
The team at CafΓ© Pandasia has completed a fresh restock of coffee beans! Youβve been given two Series:
previous_inventory
: The original stock before the deliveryrestocked
: The number of units added during the restock
Youβve been asked to calculate the total updated inventory by adding the two Series together.
- Add the corresponding elements of
previous_inventory
andrestocked
Series to calculate the total current inventory. - Save the result in a new variable called
updated_inventory
.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 14