Calculating Median in univariate is quite straight forward by just sorting the data. But , in multivariate case, where different features do not follow the same ranking order, how can someone calculate?
As you have already figured out, the median of a multivariate distribution is not.a simple concept, and there is no single algorithm to depend on. However, there are several concepts well enough developed that you will find literature on them - e.g. vectors of marginal medians, the spatial median, and the Oja median. For a version with known computational simplicity try Hettmansperger, T. P., & Randles, R. (2002). A practical affine equivariant multivariate median. Biometrika, 89, 851–860.