Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that numpy has been import with the alias np . Consider the 5 by 7 array of maximum temperatures of five cities (Sydney, Melbourne,

image text in transcribed
Assume that numpy has been import with the alias np . Consider the 5 by 7 array of maximum temperatures of five cities (Sydney, Melbourne, Perth, Adelaide, Brisbane) in Australia: [[23.8, 24.9, 27. [30.5, 22.4, 28. [29.9, 28.4, 33. (3740 2370y 1505 " ~N NN - [np.nan , 32.5, 38. Use the array to create a dataframe 28.6, 27.4, 28.4, 30.8], 24,7, 24.e, 22.1, 19.4], 32.4, np.nan, 27.3, 32.8], 25.6, 26.8, 21.9, 20.5], 3, 28.9, 29.7, 30.2, 31.0]] df with the city name as the index (use the city names in the given order) and the days March 8, March 9, ... , March 14 as the columns. Your code has to handle missing values by not including them in any of the computations. Note that you have to include the non-missing values, for example, you cannot erase a column or row that contains a missing value. In separate code cells create from df : 1. A pandas series with the number of days with maximum temperature greater than 25 degrees for each city. 2. A pandas series with the average of the temperatures of the last three days for each city. 3. A pandas series with the maximum of the recorded temperatures for each day, across the cities. 4. Add a new row to df with the minimum of the recorded temperatures for each day, across the cities. Label the index for this row as 'min across cities'

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions