In [6]:
# http://bokeh.pydata.org/en/latest/docs/user_guide/setup.html#userguide-setup
from bokeh.plotting import figure, output_notebook, show
output_notebook()


Loading BokehJS ...

In [8]:
p = figure()
p.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], line_width=5)
show(p)



In [12]:
from bokeh.charts import Bar
from bokeh.sampledata.autompg import autompg as df
plot = Bar(df, 'cyl', values='mpg', title="Total MPG by CYL")
show(plot)



In [14]:
import pandas as pd
import numpy as np

print('Generating rows to skip')
s = 10000  # desired sample size
n = 5967780
path = '../../data/2001/2001.csv'
rows_to_skip = sorted(np.random.choice(np.arange(1, n + 1), (n - s), replace=False))
print('Rows to skip: ', len(rows_to_skip))
print('Loading data')
# http://pandas.pydata.org/pandas-docs/stable/io.html#date-handling
df = pd.read_csv(path,
                 encoding='iso-8859-1', engine='c',
                 skiprows=rows_to_skip,
                 parse_dates=[['Year', 'Month', 'DayofMonth']]
                )
print('Data loaded')


Generating rows to skip
Rows to skip:  5957780
Loading data
Data loaded

In [ ]: