当前位置: 首页 > 科技观察

12个简单易用的jupyterlab插件

时间:2023-03-17 16:38:35 科技观察

1.简介Jupyterlab是jupyternotebook的升级版。除了更加人性化的界面和更多用户可定制的功能外,最吸引人的是其丰富多样的扩展插件,让每一个使用jupyterlab的人都可以根据自己的需要选择安装插件,组装他们心目中的完美工作台。图1本文将介绍12个我日常工作中经常用到的jupyterlab实用插件。Jupyterlab实用插件推荐1.调试者在??jupyternotebook或jupyterlab中调试是多么痛苦。尝试过的朋友应该都有体会。但是随着jupyterlab官方插件调试器的出现,在jupyterlab中调试变得不再痛苦,充满乐趣:图2但请注意,目前的调试器插件是基于xeus内核的,即与我们平时使用的ipykernel内核不同,所以如果想在jupyterlab中使用调试器插件,需要先安装xeus内核,再安装调试器。安装过程命令如下:condainstallxeus-python=0.8.0-cconda-forgejupyterlabextensioninstall@jupyterlab/debugger官方文档:https://github.com/jupyterlab/debugger2。geojson-extension对于经常和矢量数据打交道的朋友来说,geojson格式的文件一定很熟悉,jupyterlab中的geojson-extension插件可以帮助我们在jupyterlab的界面中,打开并查看一个geojson文件地图可视化方式:图3不过需要注意的是,因为是基于leaflet的界面,所以不要用这种方式查看元素过多的geojson文件(但也不要用geojson保存很多矢量信息)格式)安装命令:jupyterlabextensioninstall@jupyterlab/geojson-extension官方文档:https://github.com/jupyterlab/jupyter-renderers3.jupyterlab-tocjupyterlab-toc帮助我们在notebook界面使用markdown创建目录,Help我们更好的整合梳理数据分析工作流程:图4安装命令:jupyterlabextensioninstall@jupyterlab/toc官方文档:https://github.com/jupyterlab/jupyterlab-toc4.jupyter-matplotlibjupyter-matplotlib帮助我们在没有tebook界面用matplotlib实现交互式绘图,只需要在绘图前执行魔术命令%matplotlibwidget,之后就全部画好了tplotlib图表可以自动转换为交互式图表:图5安装命令:pipinstallipympljupyterlabextensioninstall@jupyter-widgets/jupyterlab-managerjupyter-matplotlib官方文档:https://github.com/matplotlib/ipympl5.jupyterlab-drawiojupyterlab-drawio是一个jupyterlab界面中基于drawio绘制流程图、思维导图等示意图的插件:图6安装命令:jupyterlabextensioninstalljupyterlab-drawio官方文档:https://github.com/QuantStack/jupyterlab-drawio6.jupyterlab-execute-timejupyterlab-execute-time插件帮助我们记录jupyterlab中每个unitcell的执行开始和运行时间:图7安装命令:jupyterlabextensioninstalljupyterlab-execute-time官方文档:https://github.com/deshaw/jupyterlab-execute-time7.jupyterlab-plotlyjupyterlab-plotly是一个帮助plotly图片在jupyterlab中正常渲染的插件:图8安装命令:jupyterlabextensioninstall@jupyter-widgets/jupyterlab-managerplotlywidget@4.9.0官方文档:https://github.com/plotly/plotly.py8.jupyterlab-spreadsheetjupyterlab-spreadsheet帮助我们在jupyterlab中查看表单文件,尤其是支持查看多个工作表的excel表单文件:图9安装命令:jupyterlabextensioninstalljupyterlab-Spreadsheet官方文档:https://github.com/quigleyj97/jupyterlab-电子表格9。jupyterlab-system-monitorjupyterlab-system-monitor通过在jupyterlab界面添加资源监控组件,可以帮助我们轻松查看工作过程中的实时CPU和内存使用情况:图10安装命令:pipinstallnbresusejupyterlabextensioninstalljupyterlab-topbar-extensionjupyterlab-system-monitor官方文档:https://github.com/jtpio/jupyterlab-system-monitor10。keplergl-jupyterkeplegl-jupyter是我使用频率很高的jupyterlab插件,因为没有它我无法在jupyterlab中正常使用keplergl:图11安装命令:jupyterlabextensioninstall@jupyter-widgets/jupyterlab-managerkeplergl-jupyter官方文档:https//github.com/keplergl/kepler.gl/tree/master/bindings/kepler。gl-jupyter11.jupyterlab-kite插件在我们之前的文章中已经详细介绍过了。帮助我们在代码补全神器kite和jupyterlab之间建立通道,帮助我们使用jupyterlab中的kite代码补全服务:图12安装命令(要求jupyterlab版本大于等于2.2.0):pipinstalljupyter-kitejupyterlabextensioninstall@kiteco/jupyterlab-kite官方文档:https://github.com/kiteco/jupyterlab-kite12.jupyterlab-variableInspectorjupyterlab-variableInspector帮助我们在jupyterlab中查看当前环境中存在的变量相关信息,呈现各类对象以漂亮的界面形式:图13安装命令:jupyterlabextensioninstall@lckr/jupyterlab_variableinspector官方文档:https://github.com/lckr/jupyterlab-variableInspector