Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created May 4, 2021 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/291b5c7cbab35946204db5cdc6448f1f to your computer and use it in GitHub Desktop.
Save amankharwal/291b5c7cbab35946204db5cdc6448f1f to your computer and use it in GitHub Desktop.
import numpy as np
data = list(range(20, 100, 5))
print(data)
Q1 = np.quantile(data, 0.25)
Q2 = np.quantile(data, 0.50)
Q3 = np.quantile(data, 0.75)
print("Quartile 1 : ", Q1)
print("Quartile 2 : ", Q2)
print("Quartile 3 : ", Q3)
def QuartileDeviation(a, b):
return (a - b)/2
print(QuartileDeviation(Q3, Q1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment