Cost Analysis in Logistics
Svep för att visa menyn
Understanding cost analysis in logistics is essential for managing supply chain efficiency and profitability. Logistics costs are typically divided into several major components:
- Transportation costs are incurred when moving goods between locations;
- Warehousing costs arise from storing products;
- Handling costs cover the movement and processing of goods within facilities;
- Delay penalties are charged when shipments do not arrive on time.
Each of these components can significantly impact the total cost of logistics operations.
12345678910111213import pandas as pd # Sample data for shipments data = { "shipment_id": [101, 102, 103, 104], "base_cost": [1200, 1500, 1100, 1800], "warehousing_cost": [200, 250, 180, 300], "handling_cost": [75, 80, 70, 90], "delay_penalty": [0, 150, 0, 400] } df = pd.DataFrame(data) print(df)
With a DataFrame like the one above, you can analyze the total logistics cost for each shipment by combining all relevant cost columns. The base_cost column represents the primary transportation expense, while warehousing_cost and handling_cost account for storage and internal movement, respectively. The delay_penalty column highlights additional costs incurred when shipments are late. Calculating the total logistics cost for each shipment involves summing these columns, which helps you identify cost drivers and areas for improvement.
1234567891011# Calculate total logistics cost per shipment df["total_cost"] = df["base_cost"] + df["warehousing_cost"] + df["handling_cost"] + df["delay_penalty"] # Find shipments with the highest penalties high_penalty_shipments = df[df["delay_penalty"] > 0].sort_values(by="delay_penalty", ascending=False) print("Total logistics cost per shipment:") print(df[["shipment_id", "total_cost"]]) print("\nShipments with highest delay penalties:") print(high_penalty_shipments[["shipment_id", "delay_penalty"]])
1. Why is cost analysis important in logistics?
2. What factors can increase logistics costs unexpectedly?
3. Fill in the blank: To sum a column in a pandas DataFrame, use df['column'].____().
Tack för dina kommentarer!
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal