A.Opening a file in read mode performs which operation? a. Creates a new file b. Reads consecutive characters from a file c. Reads all the content of a file ….
determine the median (middle) and mode (most frequent) of the values in an array.
1. (Median and Mode of an array) 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 array’s shape. Test your function on three arrays of different shapes.
2. (Enhanced Median and Mode of an array) Modify your functions from the previous exercise to allow the user to provide an axis keyword argument so the calculations can be performed row-by-row or column-by-column on a two-dimensional array.