Advertisement
Deerenaros

mean of numbers from file to file

Nov 19th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. import numpy as np
  2.  
  3. with open("numbers") as inp:
  4.  with open("mean", "w") as out:
  5.   m = np.fromiter(map(float, inp), dtype=np.float).mean()
  6.   print(m, file=out)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement