Created
August 7, 2018 14:45
-
-
Save marciok/26ac2bfbab9a84314d9280f5df20d832 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
import numpy as np | |
import csv | |
import matplotlib.pyplot as plt | |
# 1. Extract Bitcoin prices and number of Google searches. | |
bitcoin_interest = {} | |
with open('bitcoin-interest.csv') as f: | |
reader = csv.reader(f) | |
for row in reader: | |
bitcoin_interest[row[0]] = row[1] | |
price_and_interest = [] | |
with open('market-price.csv') as f: | |
reader = csv.reader(f) | |
for row in reader: | |
# 2. Match the price with search date. | |
if bitcoin_interest.get(row[0], None): | |
price_and_interest.append([int(bitcoin_interest.get(row[0])), float(row[1])]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment