Created
April 17, 2016 18:49
-
-
Save mandlar/845590ed3b7037b3941d74754a6aa92c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 matplotlib.pyplot as plt | |
import numpy as np | |
import csv as csv | |
def no_commas(num): | |
if num == '': | |
num = 0 | |
else: | |
num = num.replace(',', '') | |
return float(num) | |
f = csv.reader(open('2015_buzz_scrape_Jan.csv', 'rU')) | |
header = next(f) | |
data = [] | |
for line in f: | |
StartFragmentimport matplotlib.pyplot as plt | |
import numpy as np | |
import csv as csv | |
def no_commas(num): | |
if num == '': | |
num = 0 | |
else: | |
num = num.replace(',', '') | |
return float(num) | |
f = csv.reader(open('2015_buzz_scrape_Jan.csv', 'rU')) | |
header = next(f) | |
data = [] | |
for line in f: | |
for column in line: | |
data.append(no_commas(column)) | |
data = np.array(data) | |
x1 = data[0::,7] | |
y1 = data[0::,8] | |
plt.xlim(0, 2000000) | |
plt.ylim(0, 5000) | |
plt.scatter(x1, y1) | |
plt.show() | |
EndFragment | |
data.append(no_commas(line)) | |
data = np.array(data) | |
x1 = data[0::,7] | |
y1 = data[0::,8] | |
plt.xlim(0, 2000000) | |
plt.ylim(0, 5000) | |
plt.scatter(x1, y1) | |
plt.show() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment