Mann-Whitney $U$ test is not a test of median, but rather a more general test on whether the two sample distributions are different - see this BMJ article for a discussion.
Thus, it is unlikely for an implementation of the Mann-Whitney test to compute the median of the two samples and run any direct comparisons between them, as there is no need to do that to calculate the test statistic. The implementation in SciPy is no exception.
Having that said, given you are using
scipy.stats.mannwhitneyu, which requires two array-like arguments that represent the two samples. You can simply calculate the medians by running each argument through any library that calculate the median of an array, e.g.