ENH: Speed up hdquantiles_sd() (#13566)
ENH: Speed up hdquantiles_sd() (#13566)

* Speed up hdquantiles_sd()

By changing the indexing of `xsorted`, for a data vector with 1000 points and 1 quantile, repeating the experiment 3 times, I get a speed up of 18.6x, 7.9x and 13.1x. The code also becomes more readable.

* Further speed improvement  to hdquantiles_sd()

Changing previous indexing from mask to np.delete() makes the computation 1.9x faster for len(data) == 60190

* Further improvements to hdquantiles_sd() speed

Following suggestion by @mdhaber (Matt Haberland)
ilayn/scipy,tylerjereddy/scipy,perimosocordiae/scipy,perimosocordiae/scipy,vigna/scipy,endolith/scipy,mdhaber/scipy,endolith/scipy,vigna/scipy,e-q/scipy,grlee77/scipy,rgommers/scipy,andyfaff/scipy,WarrenWeckesser/scipy,scipy/scipy,zerothi/scipy,matthew-brett/scipy,tylerjereddy/scipy,Stefan-Endres/scipy,e-q/scipy,e-q/scipy,scipy/scipy,grlee77/scipy,anntzer/scipy,ilayn/scipy,zerothi/scipy,tylerjereddy/scipy,ilayn/scipy,matthew-brett/scipy,zerothi/scipy,WarrenWeckesser/scipy,mdhaber/scipy,scipy/scipy,e-q/scipy,endolith/scipy,anntzer/scipy,vigna/scipy,vigna/scipy,endolith/scipy,Stefan-Endres/scipy,scipy/scipy,Stefan-Endres/scipy,anntzer/scipy,tylerjereddy/scipy,Stefan-Endres/scipy,WarrenWeckesser/scipy,Eric89GXL/scipy,mdhaber/scipy,anntzer/scipy,mdhaber/scipy,mdhaber/scipy,perimosocordiae/scipy,tylerjereddy/scipy,ilayn/scipy,andyfaff/scipy,ilayn/scipy,anntzer/scipy,endolith/scipy,matthew-brett/scipy,zerothi/scipy,Eric89GXL/scipy,Eric89GXL/scipy,rgommers/scipy,zerothi/scipy,WarrenWeckesser/scipy,rgommers/scipy,perimosocordiae/scipy,andyfaff/scipy,andyfaff/scipy,rgommers/scipy,grlee77/scipy,Eric89GXL/scipy,zerothi/scipy,WarrenWeckesser/scipy,grlee77/scipy,ilayn/scipy,Stefan-Endres/scipy,matthew-brett/scipy,matthew-brett/scipy,andyfaff/scipy,e-q/scipy,anntzer/scipy,Stefan-Endres/scipy,perimosocordiae/scipy,rgommers/scipy,Eric89GXL/scipy,scipy/scipy,Eric89GXL/scipy,andyfaff/scipy,mdhaber/scipy,endolith/scipy,vigna/scipy,WarrenWeckesser/scipy,grlee77/scipy,scipy/scipy,perimosocordiae/scipy