好用到飛起的12個jupyter lab插件

1 簡介

  jupyter lab作為jupyter notebook的升級改造版,除了更加人性化的交互介面以及更多的用戶自主訂製功能之外,最吸引人的就是其豐富多樣的拓展插件,使得每個使用jupyter lab的人都可以按照自己所需挑選安裝插件,組合出自己心中的完美工作台。

圖1

  本文就將給大家介紹在我的日常工作中經常使用到的12個jupyter lab實用插件。

2 jupyter lab實用插件推薦

2.1 debugger

  在jupyter notebookjupyter lab中debug有多麼蛋疼,嘗試過的朋友們應該都有所體會。但隨著jupyter lab官方插件debugger的橫空出世,在jupyter lab中進行debug變得不再痛苦,充滿了樂趣:

圖2

  但要注意當前的debugger插件基於xeus內核,這是與我們平常使用的ipykernel內核不太一樣,所以要想在jupyter lab中使用debugger插件,需要先安裝xeus內核再進行debugger的安裝,安裝過程命令如下:

conda install xeus-python=0.8.0 -c conda-forge
jupyter labextension install @jupyterlab/debugger

  官方文檔://github.com/jupyterlab/debugger

2.2 geojson-extension

  對於經常處理矢量數據的朋友而言,geojson格式的文件想必也是比較熟悉,而jupyter lab中的geojson-extension插件可以幫助我們在jupyter lab介面中以地圖可視化的方式打開查看geojson文件:

圖3

  但要注意的是,因為是基於leaflet的介面,所以不要用這種方式來查看要素太多的geojson文件(不過應該沒有人會用geojson格式存大量矢量資訊吧😁)

  安裝命令:

jupyter labextension install @jupyterlab/geojson-extension

  官方文檔://github.com/jupyterlab/jupyter-renderers

2.3 jupyterlab-toc

  jupyterlab-toc幫助我們在notebook介面利用markdown來創建目錄,輔助我們更好地整合梳理數據分析工作流:

圖4

  安裝命令:

jupyter labextension install @jupyterlab/toc

  官方文檔://github.com/jupyterlab/jupyterlab-toc

2.4 jupyter-matplotlib

  jupyter-matplotlib幫助我們在notebook介面配合matplotlib實現互動式的作圖,只需要在繪圖之前執行魔法命令%matplotlib widget,之後繪製的所有matplotlib圖表即可自動轉換為互動式的:

圖5

  安裝命令:

pip install ipympl
jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib

  官方文檔://github.com/matplotlib/ipympl

2.5 jupyterlab-drawio

  jupyterlab-drawio是一個讓我們可以在jupyter lab介面內基於drawio繪製流程圖、思維導圖等示意圖的插件:

圖6

  安裝命令:

jupyter labextension install jupyterlab-drawio

  官方文檔://github.com/QuantStack/jupyterlab-drawio

2.6 jupyterlab-execute-time

  jupyterlab-execute-time插件幫助我們在jupyter lab中記錄每個單元cell的執行開始以及運行耗時:

圖7

  安裝命令:

jupyter labextension install jupyterlab-execute-time

  官方文檔://github.com/deshaw/jupyterlab-execute-time

2.7 jupyterlab-plotly

  jupyterlab-plotly是一款幫助plotly影像在jupyter lab中正常渲染的插件:

圖8

  安裝命令:

jupyter labextension install @jupyter-widgets/jupyterlab-manager [email protected]

  官方文檔://github.com/plotly/plotly.py

2.8 jupyterlab-spreadsheet

  jupyterlab-spreadsheet幫助我們在jupyter lab中查看錶格類文件,特別是其支援查看多工作表的excel表格文件:

圖9

  安裝命令:

jupyter labextension install jupyterlab-spreadsheet

  官方文檔://github.com/quigleyj97/jupyterlab-spreadsheet

2.9 jupyterlab-system-monitor

  jupyterlab-system-monitor通過在jupyter lab介面中添加資源監視器部件,能幫助我們在工作過程中方便的看到CPU、記憶體的實時佔用情況:

圖10

  安裝命令:

pip install nbresuse
jupyter labextension install jupyterlab-topbar-extension jupyterlab-system-monitor

  官方文檔://github.com/jtpio/jupyterlab-system-monitor

2.10 keplergl-jupyter

  keplergl-jupyter是我使用非常頻繁的jupyter lab插件,因為沒有它就無法在jupyter lab中正常使用keplergl

圖11

  安裝命令:

jupyter labextension install @jupyter-widgets/jupyterlab-manager keplergl-jupyter

  官方文檔://github.com/keplergl/kepler.gl/tree/master/bindings/kepler.gl-jupyter

2.11 jupyterlab-kite

  這個插件我們之前的文章仔細介紹過,幫助我們建立程式碼補全神器kitejupyter lab之間的通道,幫助我們在jupyter lab使用kite程式碼補全服務:

圖12

  安裝命令(需要jupyter lab版本大於等於2.2.0):

pip install jupyter-kite
jupyter labextension install @kiteco/jupyterlab-kite

  官方文檔://github.com/kiteco/jupyterlab-kite

2.12 jupyterlab-variableInspector

  jupyterlab-variableInspector幫助我們在jupyter lab中查看當前環境中存在的變數相關資訊,以美觀的介面形式對多種類型的對象予以呈現:

圖13

  安裝命令:

jupyter labextension install @lckr/jupyterlab_variableinspector

  官方文檔://github.com/lckr/jupyterlab-variableInspector

  

  以上就是本文的全部內容,如有疑問歡迎在評論區與我進行討論~