draperjames / qtpandas

Qt Meets Pandas
MIT License
141 stars 53 forks source link

example not compatible with current pandas #50

Open e3rd opened 3 years ago

e3rd commented 3 years ago

I've suceeded by installing current version by

pip3 install git+https://github.com/draperjames/qtpandas.git

instead of an old version from 2016 by

pip3 install qtpandas

However, running https://github.com/draperjames/qtpandas/blob/master/examples/BasicExample.py failed with

$ python3 BasicExample.py 
Traceback (most recent call last):
  File "BasicExample.py", line 15, in <module>
    from qtpandas.views.DataTableView import DataTableWidget
  File "/home/.../.local/lib/python3.8/site-packages/qtpandas/views/DataTableView.py", line 13, in <module>
    from qtpandas.views.EditDialogs import AddAttributesDialog, RemoveAttributesDialog
  File "/home/.../.local/lib/python3.8/site-packages/qtpandas/views/EditDialogs.py", line 17, in <module>
    from pandas.tslib import NaTType
ModuleNotFoundError: No module named 'pandas.tslib'

My versions:

$ pip3 show pandas qtpandas
Name: pandas
Version: 1.3.4
Summary: Powerful data structures for data analysis, time series, and statistics
Home-page: https://pandas.pydata.org
Author: The Pandas Development Team
Author-email: pandas-dev@python.org
License: BSD-3-Clause
Location: /home/.../.local/lib/python3.8/site-packages
Requires: python-dateutil, numpy, pytz
Required-by: tabula-py, seaborn, qtpandas
---
Name: qtpandas
Version: 1.0.4
Summary: Utilities to use pandas (the data analysis / manipulation
Home-page: None
Author: None
Author-email: None
License: None
Location: /home/.../.local/lib/python3.8/site-packages
Requires: pytest-cov, pytest, easygui, qtpy, pandas, future, pytest-qt
Required-by: 
ZhongKang97 commented 2 years ago

using code pandas._libs.lib import * instead of from pandas.tslib import NaTType in the file /home/.../.local/lib/python3.8/site-packages/qtpandas/views/EditDialogs.py

ZhongKang97 commented 2 years ago

next, if there is error :AttributeError: 'DataFrame' object has no attribute 'ix' using the .loc function instead, such as result = self._dataFrame.ix[row, col] --> result = self._dataFrame.loc[row, col]

ZhongKang97 commented 2 years ago

then,if there is error: AttributeError: 'DataFrame' object has no attribute set_value using the ._set_value function instead, such as self._dataFrame.set_value(row, col, value)-->self._dataFrame._set_value(row, col, value)