Skip to content

Instantly share code, notes, and snippets.

@jiaweih
Created March 28, 2016 23:40
Show Gist options
  • Save jiaweih/aafe2fe0eaa0cb20d53e to your computer and use it in GitHub Desktop.
Save jiaweih/aafe2fe0eaa0cb20d53e to your computer and use it in GitHub Desktop.
import numpy as np
old_lst = [1,2,3]
old_std = round(np.std(old_lst),3)
N = []
for i in np.arange(0,50.0,0.0001):
new_lst = old_lst + [i]
new_std = np.std(new_lst)
if np.abs(new_std - old_std) < 0.0001:
N.append(round(i,2))
print np.max(N)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment