Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. import statistics as st
  2. xlist = []
  3.  
  4.  
  5. def data_to_numeric(flist):
  6.     for i in flist:
  7.         xlist.append(float(i))
  8.     return xlist
  9.  
  10.  
  11. with open('inputdata.txt', 'r+') as fin:
  12.     with open('outputdata.txt','w', encoding='utf-8') as fout:
  13.         content = fin.read().splitlines()
  14.         fout.write('Μέσος όρος= ' + str(round(st.fmean(data_to_numeric(content)),3))+'\n')
  15.         fout.write('Τυπική απόκλιση= ' + str(round(st.stdev(data_to_numeric(content)),3))+'\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement