tonmcg / US_County_Level_Election_Results_08-20

United States General Election Presidential Results by County from 2008 to 2016

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Newb Question - How to execute with Python 3.x

ahowl7mx opened this issue · comments

Data looks interesting but ipynb files don't execute with Python 3.6. Is there a way execute it via regular python 3?
Tried:

import os
os.system('./run-notebook.sh')

A window flashes but nothing happens. Never run a shell executable before. Alternatively, can an executable .py file initiate the project? Edit: Alternately how does the index.html work, it opens up empty without a map.

The *.ipynb files are Jupyter Notebooks- think a sort of interactive mix of code, plotting and other graphics, and more traditional documents.

" It is an interactive computational environment, in which you can combine code execution, rich text, mathematics, plots and rich media. "

You won't be able to run it with Python alone, you'll need to use the Jupyter viewer. You can find a good tutorial on it and the official website is also a good resource.

As for run-notebook.sh, that script uses docker to run the notebook in a container. If you're not familiar with docker or containers in general, what this means for you is that you just need to install docker, and when that script is run, it will fetch a set of files from the web and everything needed to run the Jupyter notebook is ready to go within that container.

If you're interested in digging into that docker image further, the specific image its pulling is slarson/scipy-notebook.

You can either use that script to run the notebook in a container (needing to install docker) or you can install Jupyter and run it directly. Hope that helps!

No issue with the ipynb. Closing issue.