#Question 4 use sku.csv and WarehouseLocations.csv# ############################################################# def warehouse_stats(sku): """ Question 4 - Read sku.csv with CSV and create a dictionary of the New SKU Statistics.
#Question 4 use sku.csv and WarehouseLocations.csv# ############################################################# def warehouse_stats(sku): """ Question 4 - Read sku.csv with CSV and create a dictionary of the New SKU Statistics.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
#Question 4 use sku.csv and WarehouseLocations.csv#
#############################################################
def warehouse_stats(sku):
"""
Question 4
- Read sku.csv with CSV and create a dictionary of the New SKU Statistics.
- The New Sku should be the key, with the corresponding value being an inner
dictionary containing the following statistics:
- 350 Loc: True if not 0
- Warehouse Qty
- Forcasted Qty
- Items/Day: can be calculated using CuFt/Day divided by
Item Cube.
This result should be an float rounded to
5 decimals places.
- In your warehouse dictionary, add an inner dictionary with key Totals which
contains:
- Total Qty in Warehouse as key "Qty": Do Not add to Totals if
'350 Loc' is not a valid location.
- Number of Valid 350 Loc as key "Valid"
Data Cleaning Steps:
- In some variates of New Sku #, the Item Cube & CuFt/Day are faulty.
Fix the manufacturers mistake. If either is **less than or equal
to 0**,
Item Cube can be assumed to be 5.0 and CuFt/Day is 10% of the
Forcasted Qty of the New Sku #. Calculate similarly, with
Forcasted Qty divided
by Item Cube, and round to 5 decimal places.
- Ensure the New SKU number is valid. Do not add to your new dictionary or
calucalte in totals
of the New SKU number of "#N/A"
Assumptions:
- You can assume all New Sku numbers are unique.
- Do not assume values are integers even if they appear to be numbers. You
may have to cast to integers or floats.
#############################################################
def warehouse_stats(sku):
"""
Question 4
- Read sku.csv with CSV and create a dictionary of the New SKU Statistics.
- The New Sku should be the key, with the corresponding value being an inner
dictionary containing the following statistics:
- 350 Loc: True if not 0
- Warehouse Qty
- Forcasted Qty
- Items/Day: can be calculated using CuFt/Day divided by
Item Cube.
This result should be an float rounded to
5 decimals places.
- In your warehouse dictionary, add an inner dictionary with key Totals which
contains:
- Total Qty in Warehouse as key "Qty": Do Not add to Totals if
'350 Loc' is not a valid location.
- Number of Valid 350 Loc as key "Valid"
Data Cleaning Steps:
- In some variates of New Sku #, the Item Cube & CuFt/Day are faulty.
Fix the manufacturers mistake. If either is **less than or equal
to 0**,
Item Cube can be assumed to be 5.0 and CuFt/Day is 10% of the
Forcasted Qty of the New Sku #. Calculate similarly, with
Forcasted Qty divided
by Item Cube, and round to 5 decimal places.
- Ensure the New SKU number is valid. Do not add to your new dictionary or
calucalte in totals
of the New SKU number of "#N/A"
Assumptions:
- You can assume all New Sku numbers are unique.
- Do not assume values are integers even if they appear to be numbers. You
may have to cast to integers or floats.
Return your final warehouse_stats dictionary
Args:
sku (csv file)
Return:
dict
Last five elements displayed:
>> warehouse_stats('sku.csv')
.....
'63149901': {'350 Loc': True,
'Forecasted Qty': '1315',
'Items/Day': 26.3,
'Warehouse Qty': '2304'},
'63149902': {'350 Loc': True,
'Forecasted Qty': '1458',
'Items/Day': 29.16,
'Warehouse Qty': '3072'},
'63149904': {'350 Loc': True,
'Forecasted Qty': '1324',
'Items/Day': 26.48,
'Warehouse Qty': '1536'},
'63149905': {'350 Loc': True,
'Forecasted Qty': '413',
'Items/Day': 8.26,
'Warehouse Qty': '1920'},
'Totals': {'Qty': 3861258, 'Valid': 3327}}
"""
pass
def update_warehouse(stats,input_file):
'''
Args:
sku (csv file)
Return:
dict
Last five elements displayed:
>> warehouse_stats('sku.csv')
.....
'63149901': {'350 Loc': True,
'Forecasted Qty': '1315',
'Items/Day': 26.3,
'Warehouse Qty': '2304'},
'63149902': {'350 Loc': True,
'Forecasted Qty': '1458',
'Items/Day': 29.16,
'Warehouse Qty': '3072'},
'63149904': {'350 Loc': True,
'Forecasted Qty': '1324',
'Items/Day': 26.48,
'Warehouse Qty': '1536'},
'63149905': {'350 Loc': True,
'Forecasted Qty': '413',
'Items/Day': 8.26,
'Warehouse Qty': '1920'},
'Totals': {'Qty': 3861258, 'Valid': 3327}}
"""
pass
def update_warehouse(stats,input_file):
'''
Expert Solution
Step 1 Introduction
A comma-separated values file which refers to the delimited text file that uses the comma to separate the values. Each line of the file which is the data record. Each record which consists of one or more fields, separated by commas. The use of the comma is used as a field separator is the source of the name for this file format
Step by step
Solved in 3 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY