I calculated the upper quartile (Q3 or 75%-tile) and lower quartile (Q1 or 25%-tile) using Numpy/Pandas and TI-nspire. But I get different values. Why does this happen?
From (5+8)/2=6.5 and (18+21)/2=19.5, Numpy/Pandas Q1 and Q3 are wrong. Why does Numpy/Pandas return wrong numbers?
import numpy as np
data=np.array([2,4,5,8,10,11,12,14,17,18,21,22,25])
q75, q25 = np.percentile(data, [75 ,25])
print(q75,q25)
df=pd.DataFrame(data)
df.describe()
Numpy returns 18.0 and 8.0. Pandas return 18.0 and 8.0. But TI-nspire returns 19.5 and 6.5.