- 029 Allens Ashur 5 Forsyth Street O Talia Simmons Check Write A Function Rainy Days Rainfall Amount Which T 1 (102.73 KiB) Viewed 62 times
029-Allens, Ashur.... 5 Forsyth Street, O'... Talia Simmons Check Write a function rainy_days (rainfall, amount) which t
-
- Posts: 43759
- Joined: Sat Aug 07, 2021 7:38 am
029-Allens, Ashur.... 5 Forsyth Street, O'... Talia Simmons Check Write a function rainy_days (rainfall, amount) which t
029-Allens, Ashur.... 5 Forsyth Street, O'... Talia Simmons Check Write a function rainy_days (rainfall, amount) which takes a nested list rainfall (a NumPy array) and amount (integer) that specifies the minimum rainfall requirement to be recorded. Then, the function returns the Python list for each week containing days it recorded raining (day is represented by index 0 as Mon, index 1 as Tue, index 2 as Wed and so on). 1 If the week's data does not contain each day's information (i.e., some data missing or extra days added), then for that week the output list will contain a string "invalid". You can assume all values in the NumPy array are numbers. For example: Test Result rainfall = np.array([ [['Wed', 'Thu', 'Sat', 'Sun'], ['Mon' [0.2, 0.0, 1.6, 4.8, 0.0, 1.2, 1.4], [3.6, 2.2, 0.0, 0.2, 0.0, 0.3, 1.3], [0.2, 0.4, 0.9, 0.0, 1.5, 0.0, 1.6] ]) amount = 1 print (rainy_days (rainfall, amount)) rainfall = np.array([ [[['invalid']], [['invalid']]] [0.2, 0.0, 1.6, 4.8, 0.0, 1.2], [0.2, 0.4, 0.9, 0.0, 1.5, 0.0, 1.6, 0.4] ]) amount = 0 print (rainy_days (rainfall, amount)) Answer: (penalty regime: 0.10%) 31 Running Tips To... 74-370KG 2409 (Bok Search Results | Bur..... 19°C Light rain