Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Analyze Inventory Health | Supply Chain Data Analysis
Practice
Projects
Quizzes & Challenges
Quiz
Challenges
/
Python for Supply Chain
Section 1. Chapitre 5
single

single

bookChallenge: Analyze Inventory Health

Glissez pour afficher le menu

Before you tackle a real-world inventory health analysis, it is important to recall why tracking stock levels is essential for supply chain efficiency. Monitoring inventory across warehouses helps you spot products at risk of stockouts, avoid costly delays, and prioritize restocking efforts. Being proactive with restocking ensures that customer demand can be met without interruption and reduces the risk of lost sales or excess expedited shipping costs. By analyzing inventory data and visualizing low-stock products, you can quickly identify which items require urgent attention and communicate these findings clearly to your team.

123456789101112
import pandas as pd # Example inventory DataFrame data = { 'Product': ['Widget A', 'Widget B', 'Widget C', 'Widget D'], 'Warehouse 1': [15, 30, 8, 45], 'Warehouse 2': [3, 12, 6, 5], 'Warehouse 3': [2, 7, 4, 10] } inventory_df = pd.DataFrame(data) print(inventory_df)
copy

Your challenge is to use the inventory DataFrame above to perform a comprehensive inventory health analysis. Calculate the total stock for each product by summing inventory across all warehouses. Identify which products have a total stock below a threshold of 20 units—these are considered low-inventory items that may require urgent restocking. Create a bar chart visualizing the stock levels of only these low-inventory products, making it easy to compare which products are most at risk. Finally, print a summary listing the names of products that need urgent restocking, so that stakeholders can take immediate action. Use the pandas and matplotlib libraries as demonstrated previously.

Tâche

Swipe to start coding

You are given a DataFrame with inventory levels for several products across three warehouses. Your task is to:

  • Calculate the total stock for each product by summing the stock across all warehouses.
  • Identify products with total stock at or below the threshold value (default is 20 units).
  • Visualize the stock levels of these low-inventory products using a bar chart.
  • Output a summary listing the names of all products that need urgent restocking.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 5
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

some-alt