In python, I can do this by using python, as in How do I calculate percentiles with python/numpy?
import numpy as np
a = np.array([1,2,3,4,5])
p = np.percentile(a, 50)
I want to know what is the convenient way in 2018 to calculate percentile in Ruby?