Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hosting ipython notebooks on Github

I maintain a Github repository with currently two ipython notebook files. My repository is here:

https://github.com/tschm/MosekRegression

When I try to open those files with the nbviewer, e.g. using

nbviewer.ipython.org

and inserting

http://nbviewer.ipython.org/urls/github.com/tschm/MosekRegression/blob/master/Data.ipynb

i get the 400 Bad Request Error. The file is good as it works when I make it available as a Gist. First research seems to indicate that this is a permission problem? I bet I do something stupid here...

Many thanks

Thomas

like image 237
tschm Avatar asked Nov 02 '13 16:11

tschm


3 Answers

Expanding on @chuwy's answer, here's a breakdown of steps. The trick is to head to your file's page on github and then click on the "Raw" button:

enter image description here

then copy the url (minus the protocol string "http://"), and prepend it with "http://nbviewer.ipython.org/urls/"

So for example, if I have my iPython notebook:

https://github.com/watsonix/prediction_for_fun_and_profit/blob/master/statsmodel_outliers.ipynb

and I want to see it in the nbviewer, I click on "Raw" to get the URL:

https://raw.githubusercontent.com/watsonix/prediction_for_fun_and_profit/master/statsmodel_outliers.ipynb

which I use to form the URL:

http://nbviewer.ipython.org/urls/raw.githubusercontent.com/watsonix/prediction_for_fun_and_profit/master/statsmodel_outliers.ipynb

voila!

like image 107
watsonic Avatar answered Nov 15 '22 22:11

watsonic


Valid link is http://nbviewer.ipython.org/urls/raw.github.com/tschm/MosekRegression/master/Minimum%20Variance.ipynb

Your link points to the github's html page with your file. You should give the raw file instead.

like image 39
chuwy Avatar answered Nov 15 '22 21:11

chuwy


It now appears that gist automatically renders iPython notebooks! I have been using nbviewer, but I just noticed that GitHub renders the ipynb file perfectly.

like image 27
Karthik Raman Avatar answered Nov 15 '22 23:11

Karthik Raman