Last active
October 14, 2016 13:52
-
-
Save ademar/61d9de8823fe4d726b83ecc081e57c43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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×pan=all") | |
rtxn=g("https://api.blockchain.info/charts/n-transactions-excluding-popular?format=csv×pan=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