Compute percentiles of a dataset using linear interpolation.
x: list or array - Numeric dataq: list or array - Percentile values (0-100)Input: x=[1,2,3,4], q=[25,50,75]
Output: [1.75, 2.5, 3.25]
Input: x=[1,2,3,4,5], q=[50]
Output: [3.0]
Input: x=[4,1,3,2], q=[25,75]
Output: [1.75, 3.25]
Use np.percentile() with method='linear'.
Convert inputs to NumPy arrays first.
Return result as NumPy array.
np.sort()Sign in to take notes on this problem
Accepts: array
Accepts: array
Compute percentiles of a dataset using linear interpolation.
x: list or array - Numeric dataq: list or array - Percentile values (0-100)Input: x=[1,2,3,4], q=[25,50,75]
Output: [1.75, 2.5, 3.25]
Input: x=[1,2,3,4,5], q=[50]
Output: [3.0]
Input: x=[4,1,3,2], q=[25,75]
Output: [1.75, 3.25]
Use np.percentile() with method='linear'.
Convert inputs to NumPy arrays first.
Return result as NumPy array.
np.sort()Sign in to take notes on this problem
Accepts: array
Accepts: array