Skip to content

Instantly share code, notes, and snippets.

@mandlar
Created April 17, 2016 18:50
Show Gist options
  • Save mandlar/b5f7afa8b7e5a614bee1f092c75cf773 to your computer and use it in GitHub Desktop.
Save mandlar/b5f7afa8b7e5a614bee1f092c75cf773 to your computer and use it in GitHub Desktop.
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:
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment