tschm
tschm

Reputation: 2955

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

Upvotes: 5

Views: 5857

Answers (3)

Karthik Raman
Karthik Raman

Reputation: 103

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.

Upvotes: 4

watsonic
watsonic

Reputation: 3373

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!

Upvotes: 7

chuwy
chuwy

Reputation: 6679

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.

Upvotes: 6

Related Questions