ENH: use numpys nanmedian if available

numpys version is several hundred times faster for repeated small
medians along a large axis. E.g. (10000, 100) -> (10000,)
Merge pull request #3725 from juliantaylor/nanmedian-numpy

ENH: use numpys nanmedian if available