Skip to content

Instantly share code, notes, and snippets.

@RyotaBannai
Last active January 12, 2019 01:57
Show Gist options
  • Save RyotaBannai/3c321f645488fb5dd575add4592b7eee to your computer and use it in GitHub Desktop.
Save RyotaBannai/3c321f645488fb5dd575add4592b7eee to your computer and use it in GitHub Desktop.
import numpy as np
x=np.array([1,4,7,2,5,7,7,8,4,6,8,30])
z=(x-x.mean(axis=0))/x.std()
#
for l in (z < z.mean() - 3*z.std(),
z > z.mean() + 3*z.std()):
if np.any(z[l]):
print(z[l])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment