Skip to content

Instantly share code, notes, and snippets.

@ademar
Last active October 14, 2016 13:52
Show Gist options
  • Save ademar/61d9de8823fe4d726b83ecc081e57c43 to your computer and use it in GitHub Desktop.
Save ademar/61d9de8823fe4d726b83ecc081e57c43 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# Wikipedia: https://en.wikipedia.org/wiki/Metcalfe%27s_law
import numpy as np
from matplotlib import pyplot as plt
import urllib
def g(u):
return urllib.urlopen(u).readlines()
rmcap=g("https://api.blockchain.info/charts/market-cap?format=csv&timespan=all")
rtxn=g("https://api.blockchain.info/charts/n-transactions-excluding-popular?format=csv&timespan=all")
mcap=np.array([float(x.split(",")[1][:-1]) for x in rmcap])
txn= np.array([float(x.split(",")[1][:-1]) for x in rtxn])
plt.plot(mcap)
plt.plot(txn**2)
plt.axes().set_yscale("log")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment