Code Monkey home page Code Monkey logo

pandasgui's People

Contributors

adamerose avatar ahmad-m-al-khateeb avatar fdion avatar guilecardoso avatar jmartens avatar john-ted avatar marco-ray avatar mswastik avatar sayonb avatar slabko avatar stephantamminga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pandasgui's Issues

Pandasgui has started for 2 seconds and got closed without any action

Hi,

I'm trying to use pandasgui with this constellation:

OS: Windows 10
pandasgui==0.2.5.1
plotly==4.11.0
PyQt5==5.15.0
PyQt5-sip==12.8.0
PyQtWebEngine==5.15.1

and with this Python script:

import pandas as pd
from pandasgui import show


df = pd.DataFrame(([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), columns=['a', 'b', 'c'])

show(df)
  • Expected result
    PandasGUI has opened and df can be analysed

  • Given result
    An empty pandasgui window was opened for 2 seconds, closed without any further actions. No error message - nothing.
    The output in the console:

Process returned 0 (0x0)        execution time : 3.395 s

In Ubuntu 20.04 - Getting error - cannot import name 'sip' from 'PyQt5' (/usr/lib/python3/dist-packages/PyQt5/__init__.py)

Below is the full error after running jupyter lab in a .ipynb notebook file in Ubuntu 20.04

import pandas as pd
from pandasgui import show
df = pd.DataFrame(([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), columns=['a', 'b', 'c'])
show(df)
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-dddd71cba70e> in <module>
      1 import pandas as pd
----> 2 from pandasgui import show
      3 from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets
      4 app = QtWidgets.QApplication([])
      5 df = pd.DataFrame(([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), columns=['a', 'b', 'c'])

~/.local/lib/python3.8/site-packages/pandasgui/__init__.py in <module>
----> 1 from pandasgui.gui import show
      2 
      3 __all__ = ["show"]

~/.local/lib/python3.8/site-packages/pandasgui/gui.py in <module>
     10 from PyQt5.QtCore import Qt
     11 
---> 12 from pandasgui.store import Store, PandasGuiDataFrame
     13 from pandasgui.utility import fix_ipython, fix_pyqt, get_logger, as_dict, delete_datasets
     14 from pandasgui.widgets.dataframe_explorer import DataFrameExplorer

~/.local/lib/python3.8/site-packages/pandasgui/store.py in <module>
      3 import pandas as pd
      4 from pandas import DataFrame
----> 5 from PyQt5 import QtCore, QtGui, QtWidgets, sip
      6 from PyQt5.QtCore import Qt
      7 import traceback

ImportError: cannot import name 'sip' from 'PyQt5' (/usr/lib/python3/dist-packages/PyQt5/__init__.py)

Running it as an application

Sorry for noob question but I am trying to run the application on VS Code but once I execute show(df) as specified on the demo.py file, the GUI screen opens and closes right away. I am not sure if this tool is intended to run that way. Am I missing something?

I am also getting the following message:
MatplotlibDeprecationWarning:
The matplotlib.backends.backend_qt4agg backend was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg

Edit: I figured out how to run it. But it would be helpful if it can be run as a desktop application

GUI Window opening and closing immediately

Hello there.

I tried running the example code. When it runs, the pandasGUI opens and closes immediately.
I don't have much to add unfortunately.

import pandas as pd
from pandasgui import show

df = pd.DataFrame(([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), columns=['a', 'b', 'c'])
show(df)

Packages used :
pandasgui 0.2.5.1
pandas 1.1.3
pip 20.2.4
python 3.8.6 x64
Pycharm 2020.2.1

Windows 10

Option for Read Only Presentation?

Hello,

I have a use case in mind that I think pandasgui might be a good fit for. Is there a way to make the grid cells immutable? I'm looking to pull in tables from a DB, and bad things will inevitably happen if folks can manipulate the data presented in the GUI before copying.

Thanks.

Window opens and closes immediately...

I tried testing with both of the following code, but both times window opens, appears as 'not responding' and closed down immediately.

I am using Win 10. All dependencies are installed. Double checked.
CMD does not show any errors.

import pandas as pd
from pandasgui import show
path = "https://raw.githubusercontent.com/adamerose/datasets/master/pokemon.csv"
pokemon = pd.read_csv(path)
gui = show(pokemon)

and following too..
import pandas as pd
from pandasgui import show
df = pd.read_excel('Data.xlsx')
gui = show(df)

There's no problem in excel file, as print(df) shows as expected.

Code export

Are there any plans to add a feature to generate and export Python code for any transformation or visualization done in the GUI? That would be very useful for newcomers to Python/pandas/Plotly to help learn, and to use PandasGUI to bootstrap the code for more complicated scripts.

Error with Plotly Express

On trying to run a given example in GH page, getting following error and no plot works. Using
OS: MacOS 10.15.7
Python: 3.6.4

PandasGUI ERROR — pandasgui.widgets.grapher — Plotly Express cannot process wide-form data with columns of different type.

pandasgui_error

TypeError: unhashable type: 'numpy.ndarray'

Hi guys,

I was trying to use pandasgui to show a DataFrame stored in feather format (access the file from here - https://github.com/shanto268/HEP_DAQ/blob/master/CrateAnalysis/processed_data/events_data_frame_800.ftr ) and ran into the following error message, not entirely sure how to resolve this.

Traceback (most recent call last):
  File "gui_ana.py", line 44, in <module>
    mdfo.gui()
  File "/Users/sshanto/hep/hep_daq/CAMAC/CrateAnalysis/MuonDataFrame.py", line 259, in gui
    show(self.events_df, settings={'block': True})
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandasgui/gui.py", line 264, in show
    pandas_gui = PandasGui(settings=settings, **kwargs)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandasgui/gui.py", line 58, in __init__
    self.store.add_dataframe(df, df_name)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandasgui/store.py", line 245, in add_dataframe
    pgdf.dataframe_explorer = DataFrameExplorer(pgdf)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandasgui/widgets/dataframe_explorer.py", line 40, in __init__
    self.statistics_tab = self.make_statistics_tab(pgdf)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandasgui/widgets/dataframe_explorer.py", line 87, in make_statistics_tab
    "N Unique": pgdf.dataframe.nunique(),
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 8730, in nunique
    return self.apply(Series.nunique, axis=axis, dropna=dropna)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 7547, in apply
    return op.get_result()
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 180, in get_result
    return self.apply_standard()
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 255, in apply_standard
    results, res_index = self.apply_series_generator()
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 284, in apply_series_generator
    results[i] = self.f(v)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 109, in f
    return func(x, *args, **kwds)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/base.py", line 1303, in nunique
    uniqs = self.unique()
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/series.py", line 1868, in unique
    result = super().unique()
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/base.py", line 1265, in unique
    result = unique1d(values)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/algorithms.py", line 389, in unique
    uniques = table.unique(values)
  File "pandas/_libs/hashtable_class_helper.pxi", line 1840, in pandas._libs.hashtable.PyObjectHashTable.unique
  File "pandas/_libs/hashtable_class_helper.pxi", line 1787, in pandas._libs.hashtable.PyObjectHashTable._unique
TypeError: unhashable type: 'numpy.ndarray'

PandasGUI (Not Responding)

Hi,
Trying to use PandasGUI on Windows 10.
Installed via pip in Python 3.8.6
Tried in both Jupyter Notebook and VS Code in .ipynb file.
Added from pandasgui import show

As soon as I use show(df) it opens and hangs on the below.

dwm_mcfci0BLJl

ModuleNotFoundError: No module named 'PyQt5.sip'

When trying the simple tutorial you have, I get the following error:

import pandas as pd
from pandasgui import show

example_df = pd.DataFrame(pd.np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]),
                          columns=['a', 'b', 'c'])
show(example_df)

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-11-449d53287c14> in <module>
      1 import pandas as pd
----> 2 from pandasgui import show
      3 
      4 example_df = pd.DataFrame(pd.np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]),
      5                           columns=['a', 'b', 'c'])

~\AppData\Roaming\Python\Python37\site-packages\pandasgui\__init__.py in <module>
----> 1 from pandasgui.gui import show
      2 
      3 __all__ = ['show']

~\AppData\Roaming\Python\Python37\site-packages\pandasgui\gui.py in <module>
      6 import pkg_resources
      7 import pandas as pd
----> 8 from PyQt5 import QtCore, QtGui, QtWidgets
      9 from PyQt5.QtCore import Qt
     10 from pandasgui.widgets import PivotDialog, ScatterDialog

ModuleNotFoundError: No module named 'PyQt5.sip'

I have this module installed as far as I can see:

(base) C:\Users\seanc>pip install pyqt5-sip
Requirement already satisfied: pyqt5-sip in c:\users\seanc\anaconda3\lib\site-packages (4.19.19)

ImportError: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-16-c5c5d8976c89> in <module>
      1 import pandas as pd
----> 2 from pandasgui import show
      3 df = pd.DataFrame(([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), columns=['a', 'b', 'c'])
      4 show(df)

/opt/conda/lib/python3.7/site-packages/pandasgui/__init__.py in <module>
----> 1 from pandasgui.gui import show
      2 
      3 __all__ = ["show"]

/opt/conda/lib/python3.7/site-packages/pandasgui/gui.py in <module>
      7 import pandas as pd
      8 import pkg_resources
----> 9 from PyQt5 import QtCore, QtGui, QtWidgets
     10 from PyQt5.QtCore import Qt
     11 

ImportError: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found (required by /opt/conda/lib/python3.7/site-packages/PyQt5/QtCore.abi3.so)

Seems like the issue is caused by a wrong qmake version based on the anaconda defaults:

!qmake --version 
QMake version 3.1
Using Qt version 5.9.7 in /opt/conda/lib
!qmake -query
QT_SYSROOT:
QT_INSTALL_PREFIX:/opt/conda
QT_INSTALL_ARCHDATA:/opt/conda
QT_INSTALL_DATA:/opt/conda
QT_INSTALL_DOCS:/opt/conda/doc
QT_INSTALL_HEADERS:/opt/conda/include/qt
QT_INSTALL_LIBS:/opt/conda/lib
QT_INSTALL_LIBEXECS:/opt/conda/libexec
QT_INSTALL_BINS:/opt/conda/bin
QT_INSTALL_TESTS:/opt/conda/tests
QT_INSTALL_PLUGINS:/opt/conda/plugins
QT_INSTALL_IMPORTS:/opt/conda/imports
QT_INSTALL_QML:/opt/conda/qml
QT_INSTALL_TRANSLATIONS:/opt/conda/translations
QT_INSTALL_CONFIGURATION:/opt/conda
QT_INSTALL_EXAMPLES:/opt/conda/examples
QT_INSTALL_DEMOS:/opt/conda/examples
QT_HOST_PREFIX:/opt/conda
QT_HOST_DATA:/opt/conda
QT_HOST_BINS:/opt/conda/bin
QT_HOST_LIBS:/opt/conda/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:linux-g++
QMAKE_VERSION:3.1
QT_VERSION:5.9.7

from PyQt5 import QtWebEngineWidgets: "ImportError"

Hi,

I installed pandasgui using pip and it installed the library but I got the following error:

from PyQt5 import QtWebEngineWidgets
ImportError: /lib/x86_64-linux-gnu/libgssapi_krb5.so.2: undefined symbol: krb5_ser_context_init, version krb5_3_MIT

I am using the package in an anaconda environment with python 3.8. Is there any specific version of PyQt5 that I need to install?

MultiIndex names are not shown

When showing a DataFrame with a MultiIndex the index columns in the gui are all labeled None even though the index labels have names.

ModuleNotFoundError: No module named 'pandasgui'

When trying to install pandasgui, I'm having this problem:

Result from my notebook below:

!pip install pandasgui:
Collecting pandasgui Using cached pandasgui-0.2.5.1.tar.gz (83 kB) Requirement already satisfied: pandas in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from pandasgui) (1.1.3) Requirement already satisfied: PyQt5 in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from pandasgui) (5.15.1) Requirement already satisfied: PyQtWebEngine in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from pandasgui) (5.15.1) Requirement already satisfied: plotly in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from pandasgui) (4.11.0) Requirement already satisfied: setuptools in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from pandasgui) (41.2.0) Requirement already satisfied: appdirs in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from pandasgui) (1.4.4) Requirement already satisfied: dacite in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from pandasgui) (1.5.1) Requirement already satisfied: pynput in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from pandasgui) (1.7.1) Requirement already satisfied: IPython in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from pandasgui) (7.18.1) Requirement already satisfied: pytz>=2017.2 in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from pandas->pandasgui) (2020.1) Requirement already satisfied: numpy>=1.15.4 in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from pandas->pandasgui) (1.19.2) Requirement already satisfied: python-dateutil>=2.7.3 in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from pandas->pandasgui) (2.8.1) Requirement already satisfied: PyQt5-sip<13,>=12.8 in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from PyQt5->pandasgui) (12.8.1) Requirement already satisfied: six in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from plotly->pandasgui) (1.15.0) Requirement already satisfied: retrying>=1.3.3 in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from plotly->pandasgui) (1.3.3) Requirement already satisfied: pygments in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from IPython->pandasgui) (2.7.1) Requirement already satisfied: pickleshare in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from IPython->pandasgui) (0.7.5) Requirement already satisfied: backcall in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from IPython->pandasgui) (0.2.0) Requirement already satisfied: decorator in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from IPython->pandasgui) (4.4.2) Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from IPython->pandasgui) (3.0.8) Requirement already satisfied: colorama; sys_platform == "win32" in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from IPython->pandasgui) (0.4.4) Requirement already satisfied: jedi>=0.10 in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from IPython->pandasgui) (0.17.2) Requirement already satisfied: traitlets>=4.2 in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from IPython->pandasgui) (5.0.5) Requirement already satisfied: wcwidth in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->IPython->pandasgui) (0.2.5) Requirement already satisfied: parso<0.8.0,>=0.7.0 in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from jedi>=0.10->IPython->pandasgui) (0.7.1) Requirement already satisfied: ipython-genutils in c:\users\halissonsg\documents\python scripts\pandasgui\lib\site-packages (from traitlets>=4.2->IPython->pandasgui) (0.2.0) Using legacy 'setup.py install' for pandasgui, since package 'wheel' is not installed. Installing collected packages: pandasgui Running setup.py install for pandasgui: started Running setup.py install for pandasgui: finished with status 'done' Successfully installed pandasgui-0.2.5.1

!pip freeze:
appdirs==1.4.4 backcall==0.2.0 colorama==0.4.4 dacite==1.5.1 decorator==4.4.2 ipython==7.18.1 ipython-genutils==0.2.0 jedi==0.17.2 numpy==1.19.2 pandas==1.1.3 pandasgui==0.2.5.1 parso==0.7.1 pickleshare==0.7.5 plotly==4.11.0 prompt-toolkit==3.0.8 Pygments==2.7.1 pynput==1.7.1 PyQt5==5.15.1 PyQt5-sip==12.8.1 PyQtWebEngine==5.15.1 python-dateutil==2.8.1 pytz==2020.1 retrying==1.3.3 six==1.15.0 traitlets==5.0.5 wcwidth==0.2.5

import pandas as pd
from pandasgui import show
:
`---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
in
1 import pandas as pd
----> 2 from pandasgui import show

ModuleNotFoundError: No module named 'pandasgui'`

I'm using Windows 10

Feature Tracker

Edit- Closing this thread since the number of feature requests from users other than myself has grown pretty large so going forward let's track each one in a new issue. If you have any feature request that doesn't have an open issue already please create one

I'll be working on the list below still but not adding to it anymore. if you see something listed that you really want implemented or needs more discussion feel free to open an issue if it doesn't have one.

Planned Enhancements

  • Set up CICD and better unit testing
  • Upgrade from PyQt5 to PyQt6
  • Add image HTML export for Grapher (Plotly)
  • Add checkbox to export dialog for whether to include index. Leave drag & drop export assuming index=False
  • Add progress indicator and status bar & log for all messages and actions
  • Column reordering
  • Column hiding/deleting
  • Improve Statistics tab (make columns selectable to show more details such as...)
    • unique values counts
    • histogram
    • Count and % missing (NaN)
  • Change column data types
  • Put new Grapher plots in tabs instead of overwriting previous plot
  • Data display format (float & date)
  • Allow multi-selection and rearranging of DataFrames in left nav menu
  • Rename dataframes
  • Drop NA / fill NA
  • Save workspace state (so you can close PandasGUI and re-open it later with all the same data/plots/filters)
  • Outlier detection
  • JMP-style 'calculated' columns which are columns with values defined by a function, that get automatically recalculated after any change to the DataFrame
  • Lasso selection in graphing UI that can filter selected points from the DataFrame
  • When you click on a cell and then click on a row, it should highlight the row (as when you just click on a row)

Done

  • Find search bar
  • Grapher tab (drag & drop columns to do plotting)
  • Column sorting
  • Filters tab
  • Make tabs detachable and dockable
  • Edit DataFrame by double clicking a single cell and typing a new value
  • Sort DataFrame by a column by left clicking the header
  • Add DataFrame graphing tab
  • Filters that can be toggled on and off
  • Action history log
  • Custom kwargs in Grapher
  • Import / Export CSV
  • Copy/Paste support in DataFrame viewer
  • Add Reshaper (pivot / melt)
  • Automatic date parsing on import
  • Dark mode
  • Generate runnable code from change history to replicate steps (including plotting)
  • Add right-click context menu on column headers
  • Add nunique column in the Grapher drag and drop interface
  • Option to delete DataFrame

Will not add

  • Automatically sync changes between DataFrames in GUI and iPython
  • Support for remote servers like Google Colab or Jupyterhub. This is not possible, you can only render PyQt5 widgets on the same machine it is running on.

Style of pandasgui overwriting style of PyQt5 Gui

When I open pandasgui from my PyQt5 MainWindow the style of pandasgui overwrites the style of the MainWindow.
I tried to work around it by using the block setting and apply my old style to the app after I close the pandasgui, but I get "QCoreApplication::exec: The event loop is already running" when I open it blocked.
Is there another workaround? Can I somehow apply my chosen style to pandasgui while opening the gui?

Problem running on Ubuntu via vscode - pandasgui 0.2.3.5

Hi Adam, when I run pandasgui ..show(titanic).. from my .py file in vscode on Ubuntu, all I get is a black window with 'pandasgui' as title. After a few seconds window closes. No errors reported.
Works Ok from Jupyter Notebook in vscode.
Any suggestions?

Error bars in scatter plot

Would like to be able to do this:

fig = px.scatter(df, x="strike", y="vol_mid", color="call_put", error_y="vol_bidask")

Thx

Using pandasgui in Colab

Hi there,

I wonder if I can run pandasgui in google colab. I tried to use the following for a virtual display but did not work

!pip install pyvirtualdisplay
from pyvirtualdisplay import Display
Display(visible=0, size=(1400, 900)).start()

Any suggestion is greatly appreciated.

Cheers,
Hossein

Cannot import pandasgui

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

jupyter and jupyterlab both, in python 3.7 pipenv virtual environments, on Ubuntu 18.04.5

Pandasgui 0.2.3 error

On Ubuntu 20, python version 3.8.2.

Doing:
pdg.show(data, settings={'block': True})

I am getting the following error:
Traceback (most recent call last):
File "/home/miguelito/Documents/GitHub/option_pricing/test_pandas.py", line 25, in
pdg.show(data, settings={'block': True})
File "/home/miguelito/.local/lib/python3.8/site-packages/pandasgui/gui.py", line 322, in show
pandas_gui = PandasGui(settings=settings, **kwargs)
TypeError: sip.wrappertype object got multiple values for keyword argument 'settings'

ImportError undefined symbol k5_buf_data

I created a new test environment as follows:

conda create -n pandasgui_test python=3.8
conda install jupyter
pip install pandasgui

Then I ran this from a Jupyter-Notebook:

from pandasgui import show
import numpy as np
df = DataFrame(np.random.randint(0, 100, (100, 150)))
show(df)

which raises:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-65274c620237> in <module>
----> 1 from pandasgui import show
      2 import numpy as np
      3 df = DataFrame(np.random.randint(0, 100, (100, 150)))
      4 show(df)

~/miniconda3/envs/pandasgui_test/lib/python3.8/site-packages/pandasgui/__init__.py in <module>
----> 1 from pandasgui.gui import show
      2 
      3 __all__ = ["show"]

~/miniconda3/envs/pandasgui_test/lib/python3.8/site-packages/pandasgui/gui.py in <module>
     12 from pandasgui.store import Store, PandasGuiDataFrame
     13 from pandasgui.utility import fix_ipython, fix_pyqt, get_logger, as_dict, delete_datasets
---> 14 from pandasgui.widgets.dataframe_explorer import DataFrameExplorer
     15 from pandasgui.widgets.find_toolbar import FindToolbar
     16 from pandasgui.widgets.json_viewer import JsonViewer

~/miniconda3/envs/pandasgui_test/lib/python3.8/site-packages/pandasgui/widgets/dataframe_explorer.py in <module>
      7 from pandasgui.utility import get_logger, nunique
      8 from pandasgui.widgets.dataframe_viewer import DataFrameViewer
----> 9 from pandasgui.widgets.grapher import Grapher
     10 from pandasgui.widgets.reshaper import Reshaper
     11 from pandasgui.widgets.filter_viewer import FilterViewer

~/miniconda3/envs/pandasgui_test/lib/python3.8/site-packages/pandasgui/widgets/grapher.py in <module>
     13 
     14 from pandasgui.utility import flatten_df, get_logger
---> 15 from pandasgui.widgets.plotly_viewer import PlotlyViewer
     16 from pandasgui.widgets.spinner import Spinner
     17 from pandasgui.widgets.dragger import Dragger, ColumnArg, Schema

~/miniconda3/envs/pandasgui_test/lib/python3.8/site-packages/pandasgui/widgets/plotly_viewer.py in <module>
     27         app.__init__(sys.argv)
     28     else:
---> 29         raise e
     30 
     31 

~/miniconda3/envs/pandasgui_test/lib/python3.8/site-packages/pandasgui/widgets/plotly_viewer.py in <module>
     15 # https://stackoverflow.com/a/57436077/3620725
     16 try:
---> 17     from PyQt5 import QtWebEngineWidgets
     18 except ImportError as e:
     19     if e.msg == "QtWebEngineWidgets must be imported before a QCoreApplication instance is created":

ImportError: /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2: symbol k5_buf_data, version krb5support_0_MIT not defined in file libkrb5support.so.0 with link time reference

Font size in plotly plot

The plotly plots on my macbook on Ubuntu 20.04 and pandasgui 0.2.3.2 have very tiny font. Wondering if there's a way to change this.. See pic below.

PandasGui small font in plot

Type Error if DataFrame contains objects

from pandasgui import show
import pandas as pd

df = pd.DataFrame({'a':[1,2,3], 'b':[[1,2,3],[4,5,6],[7,8,9]]})
show(df)

Should convert to string and show warning instead of raising exception

Filters not working

Hello,

I'm using Jupyter notebook with Windows 10 and the filters are not working.
When I add a filter I have this error :

Traceback (most recent call last):
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pandasgui\store.py", line 199, in apply_filters
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pandas\core\frame.py", line 3343, in query
    result = self.loc[res]
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pandas\core\indexing.py", line 879, in __getitem__
    return self._getitem_axis(maybe_callable, axis=axis)
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pandas\core\indexing.py", line 1110, in _getitem_axis
    return self._get_label(key, axis=axis)
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pandas\core\indexing.py", line 1059, in _get_label
    return self.obj.xs(label, axis=axis)
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pandas\core\generic.py", line 3488, in xs
    loc = self.index.get_loc(key)
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pandas\core\indexes\range.py", line 358, in get_loc
    raise KeyError(key)
KeyError: False

And the checkbox doesn't appear in the UI :

Capture d’écran (177)

There is also a small issue where the icons don't appear in the "Grapher" section :
Capture d’écran (178)

Not able to run in Ubuntu 20.04 for error related to PyQt5

Following advice from another closed issue from this repo tried this alternative way to run.

import pandas as pd
from pandasgui import show
from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets
from PyQt5.QtWebEngineWidgets import QWebEngineView
app = QtWidgets.QApplication([])
df = pd.DataFrame(([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), columns=['a', 'b', 'c'])
show(df)

But getting below error

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-8c40c842eba1> in <module>
      1 import pandas as pd
----> 2 from pandasgui import show
      3 from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets
      4 from PyQt5.QtWebEngineWidgets import QWebEngineView
      5 app = QtWidgets.QApplication([])

~/.local/lib/python3.8/site-packages/pandasgui/__init__.py in <module>
----> 1 from pandasgui.gui import show
      2 
      3 __all__ = ["show"]

~/.local/lib/python3.8/site-packages/pandasgui/gui.py in <module>
     12 from pandasgui.store import Store, PandasGuiDataFrame
     13 from pandasgui.utility import fix_ipython, fix_pyqt, get_logger, as_dict, delete_datasets
---> 14 from pandasgui.widgets.dataframe_explorer import DataFrameExplorer
     15 from pandasgui.widgets.find_toolbar import FindToolbar
     16 from pandasgui.widgets.json_viewer import JsonViewer

~/.local/lib/python3.8/site-packages/pandasgui/widgets/dataframe_explorer.py in <module>
      7 from pandasgui.utility import get_logger, nunique
      8 from pandasgui.widgets.dataframe_viewer import DataFrameViewer
----> 9 from pandasgui.widgets.grapher import Grapher
     10 from pandasgui.widgets.reshaper import Reshaper
     11 from pandasgui.widgets.filter_viewer import FilterViewer

~/.local/lib/python3.8/site-packages/pandasgui/widgets/grapher.py in <module>
     13 
     14 from pandasgui.utility import flatten_df, get_logger
---> 15 from pandasgui.widgets.plotly_viewer import PlotlyViewer
     16 from pandasgui.widgets.spinner import Spinner
     17 from pandasgui.widgets.dragger import Dragger, ColumnArg, Schema

~/.local/lib/python3.8/site-packages/pandasgui/widgets/plotly_viewer.py in <module>
     27         app.__init__(sys.argv)
     28     else:
---> 29         raise e
     30 
     31 

~/.local/lib/python3.8/site-packages/pandasgui/widgets/plotly_viewer.py in <module>
     15 # https://stackoverflow.com/a/57436077/3620725
     16 try:
---> 17     from PyQt5 import QtWebEngineWidgets
     18 except ImportError as e:
     19     if e.msg == "QtWebEngineWidgets must be imported before a QCoreApplication instance is created":

ImportError: /lib/x86_64-linux-gnu/libQt5Network.so.5: undefined symbol: _ZN15QIPAddressUtils8toStringER7QStringPh, version Qt_5

And I already have installed and upgraded PyQt5 as below

pip3 install --user --upgrade PyQt5

pip3 install --user --upgrade PyQt5-sip

supports with dark theme?

Hi, thanks for your awesome work. I love it

I didn't use every features of pandasgui yet. but i'll try.
And maybe I expect myself to write very basic tutorial for my students.

but there's few suggestion for this project.

  1. it's good to see this in colab.

스크린샷 2020-10-26 15 33 38

  1. when pandasgui didn't work in colab. i tried to use it on jupyter lab. (and it worked !)
    however as my local pc has dark theme. it didn't work properly.

스크린샷 2020-10-26 15 43 06


Here are my environments

  • macOS catalina
  • python version 3.8.3
  • pandasgui version 0.2.7
  • pandas version 1.1.2

thanks again.

qt signal in case the PandasGuiDataFrame.update() is called

first of all many thanks for creating the widgets for panda's dataframes. I use the widgets individually in my own GUI.

In my GUI I want to execute certain code once the structure of the filtered dataframe has changed. For this it would be helpful if the PandasGuiDataFrame object emits a qt signal at the end of the update() function.

If you don't like to implement this, it would be good if a small change could be made in the cast() method. Instead of testing the type hard on PandasGuiDataFrame, it would be great if you could use "isinstance". So you could create a derived class of PandasGuiDataFrame.

ImportError: Cannot load backend 'MacOSX' which requires the 'macosx' interactive framework, as 'qt5' is currently running

I'm trying to run the code on the GitHub page to show the iris and flight dataframes in ipython3 with python3 from python.org under macOS 10.14.5. There is no matplotlibrc file so the Matplotlib backend defaults to 'MacOSX' and I get the ImportError. If I set the backend to Qt5Agg or Qt5Cairo everything works. Is it possible for pandasgui to set the backend, or to add a note to the home page that this is necessary?

python 3.7.3
pandas 0.24.2
matplotlib 3.1.0
PyQt5 5.12.2
PyQt5-sip 4.19.17

This is a great way to view dataframes, especially larger ones. Thanks!

TypeError: 'exclusive' is an unknown keyword argument

I have installed the latest version today. I get the following error when running show(lib_1_3_df) with a pandas DataFrame:

Using existing QApplication instance
Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.
Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.
Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-7-b463f0b55e1e> in <module>
----> 1 show(lib_1_3_df)

~/anaconda3/lib/python3.7/site-packages/pandasgui/gui.py in show(block, *args, **kwargs)
    362     kwargs = {**kwargs, **dataframes}
    363 
--> 364     pandas_gui = PandasGUI(**kwargs)
    365 
    366     if block:

~/anaconda3/lib/python3.7/site-packages/pandasgui/gui.py in __init__(self, **kwargs)
     74 
     75         # Generates all UI contents
---> 76         self.setupUI()
     77 
     78         # %% Window settings

~/anaconda3/lib/python3.7/site-packages/pandasgui/gui.py in setupUI(self)
    131 
    132         # QMainWindow setup
--> 133         self.make_menu_bar()
    134         self.setCentralWidget(self.splitter)
    135 

~/anaconda3/lib/python3.7/site-packages/pandasgui/gui.py in make_menu_bar(self)
    190 
    191         styleMenu = menubar.addMenu('&Set Style')
--> 192         styleGroup = QtWidgets.QActionGroup(styleMenu, exclusive=True)
    193 
    194         # Add an option to the menu for each GUI style that exist for the user's system

TypeError: 'exclusive' is an unknown keyword argument

KeyError: 'pandasgui/widgets/../images/case-match.png'

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-steph'
Traceback (most recent call last):
File "test_pandas_gui.py", line 6, in
show(example_df)
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/pandasgui-0.1.14.1-py3.7.egg/pandasgui/gui.py", line 365, in show
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/pandasgui-0.1.14.1-py3.7.egg/pandasgui/gui.py", line 76, in init
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/pandasgui-0.1.14.1-py3.7.egg/pandasgui/gui.py", line 129, in setupUI
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/pandasgui-0.1.14.1-py3.7.egg/pandasgui/widgets/find_toolbar.py", line 49, in init
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/pkg_resources/init.py", line 1145, in resource_filename
self, resource_name
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/pkg_resources/init.py", line 1744, in get_resource_filename
return self._extract_resource(manager, zip_path)
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/pkg_resources/init.py", line 1765, in _extract_resource
timestamp, size = self._get_date_and_size(self.zipinfo[zip_path])
KeyError: 'pandasgui/widgets/../images/case-match.png'

No response when using block=False

tested your example of
flights = sns.load_dataset('flights')
multi = flights.set_index(['year', 'month']).unstack() # MultiIndex example
show(flights, flightsReshaped=multi, block=False)

the GUI pops up but blank out with "NoResponse"

image

Invalid Syntax: def expect(self, pattern, timeout=-1, searchwindowsize=-1, async=False):

Python 3.7.5
Install from github.

$python demo.py
Traceback (most recent call last):
File "demo.py", line 2, in
from pandasgui import show
File "/home/steph/Projects/pandasgui/pandasgui/init.py", line 1, in
from pandasgui.gui import show
File "/home/steph/Projects/pandasgui/pandasgui/gui.py", line 10, in
from pandasgui.widgets import PivotDialog, ScatterDialog
File "/home/steph/Projects/pandasgui/pandasgui/widgets/init.py", line 8, in
from pandasgui.widgets.plotly_viewer import PlotlyViewer
File "/home/steph/Projects/pandasgui/pandasgui/widgets/plotly_viewer.py", line 5, in
import plotly
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/plotly/init.py", line 30, in
from plotly import (
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/plotly/graph_objs/init.py", line 98268, in
import ipywidgets
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/ipywidgets/init.py", line 23, in
from IPython import get_ipython
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/IPython/init.py", line 55, in
from .core.application import Application
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/IPython/core/application.py", line 25, in
from IPython.core import release, crashhandler
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/IPython/core/crashhandler.py", line 27, in
from IPython.core import ultratb
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/IPython/core/ultratb.py", line 119, in
from IPython.utils import path as util_path
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/IPython/utils/path.py", line 17, in
from IPython.utils.process import system
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/IPython/utils/process.py", line 19, in
from ._process_posix import system, getoutput, arg_split, check_pid
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/IPython/utils/_process_posix.py", line 23, in
import pexpect
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/pexpect/init.py", line 75, in
from .pty_spawn import spawn, spawnu
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/pexpect/pty_spawn.py", line 14, in
from .spawnbase import SpawnBase
File "/home/steph/anaconda3/envs/bert/lib/python3.7/site-packages/pexpect/spawnbase.py", line 224
def expect(self, pattern, timeout=-1, searchwindowsize=-1, async=False):
^
SyntaxError: invalid syntax

Auto size columns/ Resize not working

self.parent.auto_size_column(header_index) AttributeError: 'builtin_function_or_method' object has no attribute 'auto_size_column'

self.parent.dataView.setColumnWidth( AttributeError: 'builtin_function_or_method' object has no attribute 'dataView'

Variable Dragging not working on osx

I love this project. I can see myself using it constantly. It really fits a niche of working between spreadsheet and notebook. I actually think you could charge for this when it's mature.

Running miniconda python on OSX Cataline, and when trying to plot, the variables won't drag over. Let me know the best way to communicate my system state, and I can give you what you need.

Here's my setup.

λ which python
/Users/rob/miniconda/envs/viz/bin/python
•_simbiz•[mac_pro][19:17:04]( master )[ ~/rob/repos/sales_ops ]
λ python --version
Python 3.6.8 :: Anaconda, Inc.
•_simbiz•[mac_pro][19:17:08]( master )[ ~/rob/repos/sales_ops ]
λ pip freeze | grep gui
pandasgui==0.2.4.3
λ pip freeze | grep -i pyqt
PyQt5==5.15.1
PyQt5-sip==12.8.1
PyQtWebEngine==5.15.1

Getting error with 2.3.5

Just updated, and code that used to work (from 2.3.2) now does not.

Error:
File "/home/miguelito/.local/lib/python3.8/site-packages/pandasgui/gui.py", line 319, in show
pandas_gui = PandasGui(settings=settings, **kwargs)
File "/home/miguelito/.local/lib/python3.8/site-packages/pandasgui/gui.py", line 57, in init
self.store.add_dataframe(df, df_name)
File "/home/miguelito/.local/lib/python3.8/site-packages/pandasgui/store.py", line 240, in add_dataframe
pgdf.dataframe_explorer = DataFrameExplorer(pgdf)
File "/home/miguelito/.local/lib/python3.8/site-packages/pandasgui/widgets/dataframe_explorer.py", line 48, in init
self.reshaper_tab = Reshaper(pgdf)
File "/home/miguelito/.local/lib/python3.8/site-packages/pandasgui/widgets/reshaper.py", line 30, in init
self.plot_type_picker.setWordWrap(True)
AttributeError: 'Reshaper' object has no attribute 'plot_type_picker'

Sync modifications in GUI to iPython & record history

I noticed that you're looking for feedback... and I think this project is on to something...

My dream DataFrame viewer would work like this:

from pandasgui import DataFrameViewer
viewer = DataFrameViewer()
viewer.open()  # opens a GUI window
viewer.bind(df1)  # tab 1 in the viewer
viewer.bind(df2)  # tab 2 in the viewer
viewer.bind(df3)  # tab 3 in the viewer

Now when you change a cell value in the GUI, the application "pushes" the code to the python/ipython shell i.e., you see df1.at['row', 'col'] = 10 in the shell.

Moreover, if you type df1.at['row', 'col'] = 20 in the shell, the value automatically changes in the GUI. I think such an application would be 1000+ Github stars in no time.

TypeError: unhashable type: 'list'

Problem: dataframes containing a column with entries of type List fail to load.

Step to reproduce: try to show() a pandas dataframe where one column is all, or has some, List objects in it.

Expected Behavior: window shows with data instead of blank.

There is an 【endless loop】at "Download png" button

Hi, when I hit the button of 'Download plot as a png', the dialog box come up.
When hit the "save" button, the png file not saved and the dialog show again, even hit the "cancel" button the dialog show again and again, maybe an endless loop here.
download_png_bug

My version:

pandasgui==0.2.7
PyCharm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.