code: def scoreatpercentile(data,per,axis=0):
      'like the function in scipy.stats but with an axis argument and works on arrays'
      a = np.sort(data,axis=axis)
      idx = per/100. * (data.shape[axis]-1)
  
      if (idx % 1 == 0):
          return a[[slice(None) if ii != axis else idx for ii in range(a.ndim)]]
      else:
          lowerweight = 1-(idx % 1)
          upperweight = (idx % 1)
          idx = int(np.floor(idx))
          return lowerweight * a[[slice(None) if ii != axis else idx for ii in range(a.ndim)]] \
                  + upperweight * a[[slice(None) if ii != axis else idx+1 for ii in range(a.ndim)]f scoreatpercentile(data,per,axis=0):
      'like the function in scipy.stats but with an axis argument and works on arrays'
      a = np.sort(data,axis=axis)
      idx = per/100. * (data.shape[axis]-1)
  
      if (idx % 1 == 0):
          return a[[slice(None) if ii != axis else idx for ii in range(a.ndim)]]
      else:
          lowerweight = 1-(idx % 1)
          upperweight = (idx % 1)
          idx = int(np.floor(idx))
          return lowerweight * a[[slice(None) if ii != axis else idx for ii in range(a.ndim)]] \
                  + upperweight * a[[slice(None) if ii != axis else idx+1 for ii in range(a.ndim)]]
docs: like the function in scipy.stats but with an axis argument and works on arrays