Advertisement
Guest User

Untitled

a guest
Jul 4th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. import csv;
  2.  
  3. f = open("btc.csv", "r");
  4. c = csv.reader(f, delimiter=",");
  5.  
  6. fm = open("more.csv", "w");
  7. fl = open("less.csv", "w");
  8. fn = open("normal.csv", "w");
  9.  
  10. pctTotal = 0.0;
  11. addresses = 0;
  12. for row in c:
  13.     btcPaid = float(row[2]);
  14.     shouldReceive = (btcPaid/3055.120324)*15000000;
  15.     gets = float(str(row[3]).replace(",", ""));
  16.    
  17.     pct = gets/shouldReceive;
  18.     if pct > 1.0:
  19.         fm.write(row[0]);
  20.         fm.write("\n");
  21.     elif pct < 1.0:
  22.         fl.write(row[0]);
  23.         fl.write("\n");
  24.     else:
  25.         fn.write(row[0]);
  26.         fn.write("\n");
  27.    
  28.     pctTotal += pct;
  29.     addresses += 1;
  30.  
  31. fm.close();
  32. fl.close();
  33. fn.close();
  34. print (pctTotal/addresses)*100;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement