Guest User

Untitled

a guest
Oct 12th, 2016
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import numpy as np
  3. from matplotlib import pyplot as plt
  4. import urllib
  5.  
  6. def g(u):
  7.     return urllib.urlopen(u).readlines()
  8.  
  9. rmcap=g("https://api.blockchain.info/charts/market-cap?format=csv&timespan=all")
  10. rtxn=g("https://api.blockchain.info/charts/n-transactions-excluding-popular?format=csv&timespan=all")
  11.  
  12. mcap=np.array([float(x.split(",")[1][:-1]) for x in rmcap])
  13. txn= np.array([float(x.split(",")[1][:-1]) for x in rtxn])
  14.  
  15. plt.plot(mcap)
  16. plt.plot(txn**2)
  17. plt.axes().set_yscale("log")
  18. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment