Answers for "python quartile"

1

calculate quartiles python

# credit to the source link

import numpy as np

quant = np.quantile(arr, q)

# arr: array - like object (list or np.array)
# q: float from 0 to 1
Posted by: Guest on May-05-2021
0

python quartile

# Python Program illustrating 
# numpy.quantile() method 
import numpy as np
  
  
# 1D array 
arr = [20, 2, 7, 1, 34]
  
print("arr : ", arr) 
print("Q2 quantile of arr : ", np.quantile(arr, .50))
print("Q1 quantile of arr : ", np.quantile(arr, .25))
print("Q3 quantile of arr : ", np.quantile(arr, .75))
print("100th quantile of arr : ", np.quantile(arr, .1))
Posted by: Guest on October-17-2021

Python Answers by Framework

Browse Popular Code Answers by Language