SHARE
TWEET

Untitled

a guest Nov 19th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import statistics
  2.  
  3. def clean(csv_list):
  4.   a = csv_list.split(',')
  5.   print(a)
  6.   b =[]
  7.   for i in a:
  8.     i = i.replace("'",'')
  9.     print(i)
  10.     if(i is 'None' or i is''):
  11.       continue
  12.     try:
  13.         print(int(i))
  14.         b.append(int(i))
  15.     except:
  16.         continue
  17.   return b
  18.  
  19.  
  20. def get_stats(csv_string):
  21.   valid = clean(csv_string)
  22.   return (len(valid),statistics.stdev(valid),statistics.mean(valid))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top