help pls, make it pylint compatible

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
correctanswer
Posts: 43759
Joined: Sat Aug 07, 2021 7:38 am

help pls, make it pylint compatible

Post by correctanswer »

help pls, make it pylint compatible
Help Pls Make It Pylint Compatible 1
Help Pls Make It Pylint Compatible 1 (168.12 KiB) Viewed 56 times
Write a function rainy_days (rainfall) which takes a nested list rainfall (type is NumPy array). Then, the function returns the week with the highest rainfall observed. Week index starts from 0 (i.e., the first row is week 0, the second row is week 1 etc.). If the week's data does not contain each day's information (i.e., some data missing or extra days added), then that week's data is ignored wholly (but it is still counted as a week). If there are no valid weeks (all weekly measures are invalid), then the function returns -1. You can assume all values in the NumPy array are numbers. You can also assume no two weeks will have to same average rainfalls. For example: Test rainfall = np.array([ [0.2, 0.0, 1.6, 4.8, 9.0, 1.2, 1.4], #week 1 total 18 [3.6, 2.2, 0.0, 0.2, 3.0, 0.3, 1.3], #week 2 total 16 [0.2, 0.4, 0.9, 0.0, 1.5, 0.0, 1.6] 1) #week 3 total 4. print (rainy_days (rainfall)) rainfall = np.array([ [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] 1) #all weeks are invalid measurements, so return -1 print (rainy_days (rainfall))
For example: np.array([ 0.0, 1.6, 4.8, 9.0, 1.2, 1.4], 3 2.2, 0.0, 0.2, 3.0, 0.3, 1.3], 3 , 0.4, 0.9, 0.0, 1.5, 0.0, 1.6] ]) y_days (rainfall)) np.array([ , 0.0, 1.6, 4.8, 0.0, 1.2], 0.4, 0.9, 0.0, 1.5, 0.0, 1.6, 0.4] ]) > are invalid measurements, so return -1 y_days (rainfall)) #week 1 Total 18.2 #week 2 total 10.6 #week 3 total 4.6 Result 0 -1
Register for solutions, replies, and use board search function. Answer Happy Forum is an archive of questions covering all technical subjects across the Internet.
Post Reply