#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...
icon
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.
 
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):
'''
sku
GT SKU New SKU 350 Loc Warehouse Qty Forecasted Quantity Item Cube CuFt/Day
26359737 60317858
0
52
335061
7.875
100.7
26483737 62409025
0
20118
26488614 62378835
0
15400
26393062 60636992
2
15174
26483730 61788007
0
14600
26487386 61788017
0
12909
26410944 60739272
12317
26487394 62409032
12156
11861
11071
10637
26139575 59326743
26488610 61788018
26495972 61787971
26488612 62378833
26488613 62378834
26483731 61788006
26410946 60739273
26416317 61787924
26353200 60379950
26438803 60730169
26487391 62409027
26487393 62409028
26299738 60907096
26474053 61788003
26487385 61788016
26470439 61788014
26416311 61787922
26393064 60636981
26468309 61787985
26468313 61788000
26488615 62378836
26416319 61787926
26393063 60636985
26455859 62167982
26353220 60379946
26439896 61652211
26474055 61788005
26393067 60636994
26397324 60907099
26393066 60636993
26468311 61787999
26468312 61787986
26412381 61269068
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
3
1
0
0
0
15014
10382
16907
10744
567
9173
1257
0
6442
0
13547
8989
11080
3302
3821
7848
0
5872
5230
-4
447
13671
0
9004
10560
18718
14677
8816
9421
16559
15689
3287
9035
0
4363
10272
15766
13225
17481
9088
32.625
32.625
32.625
32.625
32.625
32.625
32.625
4.5
32.625
32.625
10206
32.625
9708
32.625
7973
32.625
7651
31.68
7286
32.625
7164 29.9062
7095
5.0625
6167
32.625
6138
32.625
6133 81.2813
6006
28.125
5822
32.625
28.125
32.625
32.625
32.625
32.625
32.625
32.625
32.625
32.625
5774
5656
5629
5379
5356
5336
4965
4938
4675
4346
4089
3938
3911
32
31
28.125
32.625
3900
7.875
3874
32.625
3784
32.625
3732
32.625
3694 22.9687
25
19.2
18.9
18.2
16.1
15.3
15.1
2
13.8
13.2
12.7
12.1
9.9
9.2
9.1
8.2
1.4
7.7
7.6
19
6.4
7.2
6.2
7
7
6.7
6.7
6.6
6.2
6.1
5.8
5.3
4.8
4.2
4.9
1.2
4.8
4.7
4.6
3.2
Transcribed Image Text:sku GT SKU New SKU 350 Loc Warehouse Qty Forecasted Quantity Item Cube CuFt/Day 26359737 60317858 0 52 335061 7.875 100.7 26483737 62409025 0 20118 26488614 62378835 0 15400 26393062 60636992 2 15174 26483730 61788007 0 14600 26487386 61788017 0 12909 26410944 60739272 12317 26487394 62409032 12156 11861 11071 10637 26139575 59326743 26488610 61788018 26495972 61787971 26488612 62378833 26488613 62378834 26483731 61788006 26410946 60739273 26416317 61787924 26353200 60379950 26438803 60730169 26487391 62409027 26487393 62409028 26299738 60907096 26474053 61788003 26487385 61788016 26470439 61788014 26416311 61787922 26393064 60636981 26468309 61787985 26468313 61788000 26488615 62378836 26416319 61787926 26393063 60636985 26455859 62167982 26353220 60379946 26439896 61652211 26474055 61788005 26393067 60636994 26397324 60907099 26393066 60636993 26468311 61787999 26468312 61787986 26412381 61269068 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 3 1 0 0 0 15014 10382 16907 10744 567 9173 1257 0 6442 0 13547 8989 11080 3302 3821 7848 0 5872 5230 -4 447 13671 0 9004 10560 18718 14677 8816 9421 16559 15689 3287 9035 0 4363 10272 15766 13225 17481 9088 32.625 32.625 32.625 32.625 32.625 32.625 32.625 4.5 32.625 32.625 10206 32.625 9708 32.625 7973 32.625 7651 31.68 7286 32.625 7164 29.9062 7095 5.0625 6167 32.625 6138 32.625 6133 81.2813 6006 28.125 5822 32.625 28.125 32.625 32.625 32.625 32.625 32.625 32.625 32.625 32.625 5774 5656 5629 5379 5356 5336 4965 4938 4675 4346 4089 3938 3911 32 31 28.125 32.625 3900 7.875 3874 32.625 3784 32.625 3732 32.625 3694 22.9687 25 19.2 18.9 18.2 16.1 15.3 15.1 2 13.8 13.2 12.7 12.1 9.9 9.2 9.1 8.2 1.4 7.7 7.6 19 6.4 7.2 6.2 7 7 6.7 6.7 6.6 6.2 6.1 5.8 5.3 4.8 4.2 4.9 1.2 4.8 4.7 4.6 3.2
WarehouseLocations
New SKU Warehouse Location
60317858 A2
62409025 F14
62378835 C2
60636992 E6
61788007 E8
61788017 C16
60739272 C10
62409032 A2
59326743 DO
61788018 A18
61787971 C12
62378833 D14
62378834 E6
61788006 B10
60739273 F16
61787924 B14
60379950 Co
60730169 B2
62409027 A10
62409028 C2
60907096 E12
61788003 DO
61788016 F18
61788014 E4
61787922 D12
60636981 D10
61787985 AO
61788000 E10
62378836 D4
61787926 B12
60636985 B12
62167982 E16
60379946 C8
61652211 D2
61788005 EO
60636994 C18
60907099 D14
60636993 AO
61787999 B10
61787986 E8
61269068 A6
Transcribed Image Text:WarehouseLocations New SKU Warehouse Location 60317858 A2 62409025 F14 62378835 C2 60636992 E6 61788007 E8 61788017 C16 60739272 C10 62409032 A2 59326743 DO 61788018 A18 61787971 C12 62378833 D14 62378834 E6 61788006 B10 60739273 F16 61787924 B14 60379950 Co 60730169 B2 62409027 A10 62409028 C2 60907096 E12 61788003 DO 61788016 F18 61788014 E4 61787922 D12 60636981 D10 61787985 AO 61788000 E10 62378836 D4 61787926 B12 60636985 B12 62167982 E16 60379946 C8 61652211 D2 61788005 EO 60636994 C18 60907099 D14 60636993 AO 61787999 B10 61787986 E8 61269068 A6
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

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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 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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY