Question: NumPy arrays offer a mean method, but not median or mode. Write functions median and mode that use existing NumPy capabilities to determine the median

NumPy arrays offer a mean method, but not median or mode. Write functions median and mode that use existing NumPy capabilities to determine the median (middle) and mode (most frequent) of the values in an array. Your functions should determine the median and mode regardless of the arrays shape. Test your function on three arrays of different shapes.

Perform the following tasks with pandas Series:

  1. Create a Series from the list [7, 11, 13, 17].
  2. Create a Series with five elements that are all 100.0.
  3. Create a Series with 20 elements that are all random numbers in the range 0 to 100. Use method describe to produce the Series basic descriptive statistics.
  4. Create a Series called temperatures of the floating-point values 98.6, 98.9, 100.2 and 97.9. Using the index keyword argument, specify the custom indices 'Julie', 'Charlie', 'Sam' and 'Andrea'.
  5. Form a dictionary from the names and values in Part (d), then use it to initialize a Series.

Using Python language

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!