You are viewing a single comment's thread. Return to all comments →
#python from statistics import median def quartiles(arr): arr.sort() Q2=median(arr) if len(arr) %2!=0: Q1=median(arr[:len(arr)//2]) Q3=median(arr[(len(arr)//2)+1:]) else: Q1=median(arr[:len(arr)//2]) Q3=median(arr[len(arr)//2:]) return [int(Q1), int(Q2), int(Q3)]
Seems like cookies are disabled on this browser, please enable them to open this website
Day 1: Quartiles
You are viewing a single comment's thread. Return to all comments →