Let’s see how to calculate deciles in Python.
Calculating deciles in Python
To calculate deciles, we need to import the statistics module.
Luckily, there is a dedicated function in the statistics module to calculate deciles.
import statistics as s x = [1, 5, 7, 5, 43, 43, 8, 43, 6, 65, 63, 42, 1, 76, 43, 87, 53, 54] deciles = s.quantiles(x, n=10) print("Deciles are: " + str(deciles))