Repository navigation
Pandas 1.0.0 Compatibility #287
Copy link
Copy link
Closed
Description
Issue
Environment
- Operating System: WIN10 1903
- Python Version: 3.7.6
- How did you install Qgrid:
conda create -n qgrid_test python=3.7 qgrid pandas
Python packages in conda env:
(qgrid_test) H:\>conda list
# Name Version Build Channel
attrs 19.3.0 py_0 conda-forge
backcall 0.1.0 py_0 conda-forge
bleach 3.1.0 py_0 conda-forge
ca-certificates 2019.11.28 hecc5488_0 conda-forge
certifi 2019.11.28 py37_0 conda-forge
colorama 0.4.3 py_0 conda-forge
decorator 4.4.1 py_0 conda-forge
defusedxml 0.6.0 py_0 conda-forge
entrypoints 0.3 py37_1000 conda-forge
importlib_metadata 1.5.0 py37_0 conda-forge
inflect 4.0.0 py37_1 conda-forge
intel-openmp 2019.4 245
ipykernel 5.1.4 py37h5ca1d4c_0 conda-forge
ipython 7.11.1 py37h5ca1d4c_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.5.1 py_0 conda-forge
jaraco.itertools 5.0.0 py_0 conda-forge
jedi 0.16.0 py37_0 conda-forge
jinja2 2.11.1 py_0 conda-forge
jsonschema 3.2.0 py37_0 conda-forge
jupyter_client 5.3.4 py37_1 conda-forge
jupyter_core 4.6.1 py37_0 conda-forge
libblas 3.8.0 14_mkl conda-forge
libcblas 3.8.0 14_mkl conda-forge
liblapack 3.8.0 14_mkl conda-forge
libsodium 1.0.17 h2fa13f4_0 conda-forge
m2w64-gcc-libgfortran 5.3.0 6
m2w64-gcc-libs 5.3.0 7
m2w64-gcc-libs-core 5.3.0 7
m2w64-gmp 6.1.0 2
m2w64-libwinpthread-git 5.0.0.4634.697f757 2
markupsafe 1.1.1 py37hfa6e2cd_0 conda-forge
mistune 0.8.4 py37hfa6e2cd_1000 conda-forge
mkl 2019.4 245
more-itertools 8.2.0 py_0 conda-forge
msys2-conda-epoch 20160418 1
nbconvert 5.6.1 py37_0 conda-forge
nbformat 5.0.4 py_0 conda-forge
notebook 6.0.3 py37_0 conda-forge
numpy 1.17.5 py37hc71023c_0 conda-forge
openssl 1.1.1d hfa6e2cd_0 conda-forge
pandas 1.0.0 py37he350917_0 conda-forge
pandoc 2.9.1.1 0 conda-forge
pandocfilters 1.4.2 py_1 conda-forge
parso 0.6.0 py_0 conda-forge
pickleshare 0.7.5 py37_1000 conda-forge
pip 20.0.2 py37_1 conda-forge
prometheus_client 0.7.1 py_0 conda-forge
prompt_toolkit 3.0.3 py_0 conda-forge
pygments 2.5.2 py_0 conda-forge
pyrsistent 0.14.11 py37hfa6e2cd_1 conda-forge
python 3.7.6 h5b45d93_2 conda-forge
python-dateutil 2.8.1 py_0 conda-forge
pytz 2019.3 py_0 conda-forge
pywin32 225 py37hfa6e2cd_0 conda-forge
pywinpty 0.5.7 py37_0 conda-forge
pyzmq 18.1.1 py37h16f9016_0 conda-forge
qgrid 1.1.1 py37_1001 conda-forge
send2trash 1.5.0 py_0 conda-forge
setuptools 45.1.0 py37_0 conda-forge
six 1.14.0 py37_0 conda-forge
sqlite 3.30.1 hfa6e2cd_0 conda-forge
terminado 0.8.3 py37_0 conda-forge
testpath 0.4.4 py_0 conda-forge
tornado 6.0.3 py37hfa6e2cd_0 conda-forge
traitlets 4.3.3 py37_0 conda-forge
vc 14.1 h0510ff6_4
vs2015_runtime 14.16.27012 hf0eaf9b_1
wcwidth 0.1.8 py_0 conda-forge
webencodings 0.5.1 py_1 conda-forge
wheel 0.34.2 py37_0 conda-forge
widgetsnbextension 3.5.1 py37_0 conda-forge
wincertstore 0.2 py37_1003 conda-forge
winpty 0.4.3 4 conda-forge
zeromq 4.3.2 h6538335_2 conda-forge
zipp 2.1.0 py_0 conda-forge
Jupyterlab extensions:
Runs in base environment accesses the environment kernel using nb_conda_kernels
(base) H:\>labextension list
JupyterLab v1.2.6
Known labextensions:
app dir: C:\ProgramData\Miniconda3\share\jupyter\lab
@aquirdturtle/collapsible_headings v0.5.0 enabled ok
@bokeh/jupyter_bokeh v1.1.1 enabled ok
@jupyter-widgets/jupyterlab-manager v1.1.0 enabled ok
@jupyterlab/toc v1.0.1 enabled ok
@lckr/jupyterlab_variableinspector v0.3.0 enabled ok
@pyviz/jupyterlab_pyviz v0.8.0 enabled ok
jupyter-matplotlib v0.5.0 enabled ok
jupyterlab-jupytext v1.1.1 enabled ok
jupyterlab-system-monitor v0.4.1 enabled ok
jupyterlab-theme-toggle v0.4.2 enabled ok
jupyterlab-topbar-extension v0.4.0 enabled ok
qgrid v1.1.1 enabled ok
Description of Issue
Qgrid seems to be incompatible with Pandas 1.0.0.
Reproduction Steps
Notebook Cell:
import qgrid
qwid = qgrid.show_grid(pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]}), show_toolbar=True)
qwidOutput:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-26-f756e5d59b94> in <module>
1 import qgrid
----> 2 qwid = qgrid.show_grid(pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]}), show_toolbar=True)
3 qwid
~\.conda\envs\WeldCompare\lib\site-packages\qgrid\grid.py in show_grid(data_frame, show_toolbar, precision, grid_options, column_options, column_definitions, row_edit_callback)
509 column_definitions=column_definitions,
510 row_edit_callback=row_edit_callback,
--> 511 show_toolbar=show_toolbar)
512
513
~\.conda\envs\WeldCompare\lib\site-packages\qgrid\grid.py in __init__(self, *args, **kwargs)
625
626 if self.df is not None:
--> 627 self._update_df()
628
629 def _grid_options_default(self):
~\.conda\envs\WeldCompare\lib\site-packages\qgrid\grid.py in _update_df(self)
818 self._unfiltered_df = self._df.copy()
819
--> 820 self._update_table(update_columns=True, fire_data_change_event=False)
821 self._ignore_df_changed = False
822
~\.conda\envs\WeldCompare\lib\site-packages\qgrid\grid.py in _update_table(self, update_columns, triggered_by, scroll_to_row, fire_data_change_event)
877 isinstance(col_series, pd.PeriodIndex)
878
--> 879 if type(df.index) == pd.core.index.MultiIndex:
880 self._multi_index = True
881 for idx, cur_level in enumerate(df.index.levels):
AttributeError: module 'pandas.core' has no attribute 'index'Possible solution
From Pandas Release Notes:
pandas.core.index has been deprecated and will be removed in a future version, the public classes are available in the top-level namespace (GH19711)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
ajp619 commentedon Jan 31, 2020
+1 same issue
I was able to get things working by modifying grid.py:
if type(df.index) == pd.core.index.MultiIndex:->if type(df.index) == pd.MultiIndex:if type(df.index) == pd.core.index.MultiIndex and \->if type(df.index) == pd.MultiIndex and \DinisCruz commentedon Feb 5, 2020
Just got hit by this issue too, so is the solution to downgrade for now, and then use the release the qgrid that has the update merged above?
richlysakowski commentedon Feb 6, 2020
The code edits above worked for me. I am so grateful, since I want to work with the latest pandas and Python 3.7 and not go backward. Can someone please push the edits to the Quantopian Qgrid repository?
update grid.py
richlysakowski commentedon Feb 6, 2020
I pushed the edits to the Quantopian github repo for this. I need someone to approve it to become part of the master.
astrojuanlu commentedon Feb 7, 2020
Fixed in #290. Plans for a release? :)
bajizhh commentedon Feb 11, 2020
i have the same error, fixing it please!
richlysakowski commentedon Feb 11, 2020
jongablop commentedon Feb 15, 2020
Does anyone know when will be the fixed version released so it can be installed through pip?
richlysakowski commentedon Feb 15, 2020
racuna commentedon Feb 17, 2020
I had to downgrade. I hope the fix will release soon.
gerrymanoim commentedon Feb 18, 2020
Hey all - thanks for all the reports/follow ups here! I'm currently working on a new CI/CD branch (#293) that uncovered some issues with pandas 1.0.1/qgrid. Namely:
to_jsonof Series with period dtype results in AttributeError pandas-dev/pandas#31917)Once we fix or work around these issues, we'll cut a new release.
gerrymanoim commentedon Feb 25, 2020
We've now released a new version. Period columns are still broken, but otherwise it is good to use with pandas 1.0
andreassimon commentedon Mar 21, 2020
I just tried to install version 1.3.0 of qgrid via conda, but the most recent version in conda-forge seems to be 1.1.1. Is there another way to get 1.3.0 into Jupyter Lab?
senkin commentedon Mar 30, 2020
@andreassimon I managed to bypass this by installing pip within the conda environment and just upgrading qgrid with
pip install qgrid --upgrade. I also had to remove the virualenv requirement of pip withexport PIP_REQUIRE_VIRTUALENV=false. Hope this helps!samlakhmani commentedon Jun 14, 2020
I am a beginner, can someone tell me how to make this edit in the local
The problem is still there in June
CarlosGrohmann commentedon Jun 15, 2020
I confirm this is still present in v.1.3.1 (Manjaro Linux, Pandas 1.0.3, no virtualenv)
mkincaid commentedon Aug 6, 2020
Contra preceding two comments, I had this issue in 1.1.1 but did find it fixed after upgrading to 1.3.1. The issue may be that "stable" anaconda still provides qgrid 1.1.1; you need conda-forge enabled to get 1.3.1.
To fix in Navigator:
Environmentstab, clickChannelsbuttonconda-forgeand hit returnUpdate channelsbuttonTo fix from command line:
conda install qgridconda config --remove channels conda-forgealexmill commentedon Aug 10, 2021
To follow up on @mkincaid's comment, note you can install qgrid 1.3.1 from the conda-forge channel in one line with:
conda install -c conda-forge qgrid=1.3.1This does not require you to make conda-forge your default channel for your environment.