我正在尝试在另一个“输出视图”选项卡中显示我的熊猫数据框,如此图像所示。
https://github.com/quantopian/qgrid/blob/master/docs/images/events_api.gif
我可以使用以下命令安装并尝试qgrid的基本功能。但无法获得上面显示的确切视图。
!pip install qgrid
!jupyter nbextension enable --py --sys-prefix qgrid
!jupyter nbextension enable --py --sys-prefix widgetsnbextension
import qgrid
import pandas as pd
df = pd.read_csv('some.csv')
qgrid_widget = qgrid.show_grid(df, show_toolbar=True)
qgrid_widget
qgrid_widget.get_changed_df()
这些命令应该起作用:
1. Assume you have conda environment called "myenv"
2. Assume you have jupyter-lab installed in that environment
source activate myenv
pip install qgrid
jupyter labextension install qgrid
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter nbextension enable --py --sys-prefix qgrid
jupyter nbextension enable --py --sys-prefix widgetsnbextension
source activate myenv
jupyter-lab
create a notebook under environment myenv
-------------------这些只是预安装过程-------
------------------ -这是在Jupyter Lab中使用qgrid的方式----------
# Lets say you have a pandas dataframe `df`
qgrid_widget = qgrid.show_grid(df.head(), show_toolbar=True)
qgrid_widget
qgrid_widget.get_changed_df()
# right click on this cell
# click Create New View for Output # it will create new tab
# You will see the new window of dataframe
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句