從github上下載的ipynb文件的打開方法

轉自 :https://www.cnblogs.com/brooksj/p/10301444.htmlhtml

描述:以前在公號看到一篇文章,文中有大量代碼,處於對知識的渴求(實際上是懶),想要本身跑一遍。做者將代碼上傳至github,而代碼文件後綴爲ipynb。原本要用本身的jupyter打開,但老是提示以下錯誤:python

Unreadable Notebook: D:\file_saving\mooc_learning\plotly_express\Plotly-Express-Introducing.ipynb NotJSONError("Notebook does not appear to be JSON: '\\n\\n\\n\\n\\n\\n<!DOCTYPE html>\\n<html lang...",)git

這個對於我一個編程初期愛好者來講,不算事,秉持遇山開路的大無畏精神,我用notepad++打開文件一探究竟,以下圖所示,果斷放棄!!!github

解決方法以下:express

step1:找到ipynb文件在github上的url  https://github.com/liyangbit/PyDataRoad/blob/master/comprehensive/Plotly-Express-Introducing/Plotly-Express-Introducing.ipynb編程

step2: 截取上面URL中github.com以後的部分,這裏指liyangbit/PyDataRoad/blob/master/comprehensive/Plotly-Express-Introducing/Plotly-Express-Introducing.ipynb,而後將其與http://nbviewer.ipython.org拼接組成新的URL,即http://nbviewer.ipython.org/liyangbit/PyDataRoad/blob/master/comprehensive/Plotly-Express-Introducing/Plotly-Express-Introducing.ipynb,將新的UL在瀏覽器打開便可,結果以下圖瀏覽器

相關文章
相關標籤/搜索