Skip to content

Instantly share code, notes, and snippets.

@aspiringguru
Created February 22, 2017 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspiringguru/4ef8001d83604fc583d09e2393a06681 to your computer and use it in GitHub Desktop.
Save aspiringguru/4ef8001d83604fc583d09e2393a06681 to your computer and use it in GitHub Desktop.
python numpy mean being weird
import numpy as np
x = [-1.58, 0.91, -0.73, -4.22, 4.19, -0.33]
print x
print np.median(x, axis=0)
print np.median(x)
print np.mean(x)
x = np.sort(x)
print x
print np.median(x, axis=0)
print np.median(x)
print np.mean(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment