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:
- Create a Series from the list [7, 11, 13, 17].
- Create a Series with five elements that are all 100.0.
- 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.
- 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'.
- 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
Get step-by-step solutions from verified subject matter experts
