/jupyter-starter

Starter repo with the bare minimum (plus a few of my favorite libs) to start a new jupyter notebook

Primary LanguageJupyter Notebook

jupyter-starter

Starter repo with the bare minimum to start a new jupyter notebook

Assumptions

The following things are assumed to be true in this documentation.

  • You are running OSX.
  • You are using Python 2.7. (Probably the version that came OSX.)
  • You have virtualenv and virtualenvwrapper installed and working.
  • You have NPR's AWS credentials stored as environment variables locally.

For more details on the technology stack used with the app-template, see our development environment blog post.

Bootstrap the project

cd name-of-project
mkvirtualenv name-of-project
pip install -r requirements.txt

Problems installing requirements? You may need to run the pip command as ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install -r requirements.txt to work around an issue with OSX.

Run the notebook

jupyter notebook

The homepage of the notebook should open automatically in your preferred browser. Notebooks generally run on localhost:8888 if it is the sole notebook running.

Create a new Python 2 notebook in the upper right-hand corner of the home screen.

Import the libraries in the first cell

# -*- coding: utf-8 -*-
%matplotlib inline

import pandas as pd
import numpy as np
import math
import matplotlib as mplstyle
import matplotlib.pyplot as plt
import locale
import arrow
from locale import atof
from dateutil import parser
from datetime import datetime

To run the cells, either use cmd + <enter> or use the navigation: cell -> run all