spyder
spyder copied to clipboard
Larger dataframes with columns on the far right doesnt display max values when clicking on their column names twice + Other bugs
Issue Report Checklist
Checklist checked.
Problem Description
It is hard to describe this problem so I screen-recorded the main problem, together with 1-2 other bugs (which can also been seen in the video). So if i have a larger data frame with many columns, pressing one of the column names will sort the values from min to max, and by pressing again, it will sort the values from max to min. However, if i scroll somewhat to the right (beyond what one can see when opening up a df), i can only sort by min to max, but not max to min. Also, it takes me back to column 40 (out of 80) and sometimes doesnt let me scroll to the right, unless i scroll to the left and then to the right. However, it is a bit tedious to always scroll back to column 80 again. An improvement beside fixing the max/min bug would be if it just let you stay at column 80 when clicking the column name.
https://github.com/spyder-ide/spyder/assets/123987501/2e7df699-e80f-4bb3-a97f-77ad812ccae9
What steps reproduce the problem?
import numpy as np
np.random.seed(42)
num_columns = 80
num_rows = 5000
data = np.random.rand(num_rows, num_columns)
df = pd.DataFrame(data, columns=[f'Column{i+1}' for i in range(num_columns)])
What is the expected output? What do you see instead?
That i can sort from max to min on the later columns
Versions
- Spyder version: 5.4.5 (Doesnt work in 5.5 either)
- Python version: 3.12
- Qt version: 5.15.2
- PyQt version: 5.15.10
- Operating System name/version: Win10 x64
Dependencies
# Mandatory:
atomicwrites >=1.2.0 : 1.4.1 (OK)
chardet >=2.0.0 : 5.2.0 (OK)
cloudpickle >=0.5.0 : 3.0.0 (OK)
cookiecutter >=1.6.0 : 2.5.0 (OK)
diff_match_patch >=20181111 : 20230430 (OK)
intervaltree >=3.0.2 : 3.1.0 (OK)
IPython >=7.31.1,<9.0.0,!=8.8.0,!=8.9.0,!=8.10.0,!=8.11.0,!=8.12.0,!=8.12.1 : 8.18.1 (OK)
jedi >=0.17.2,<0.19.0 : 0.18.2 (OK)
jellyfish >=0.7 : 1.0.3 (OK)
jsonschema >=3.2.0 : 4.20.0 (OK)
keyring >=17.0.0 : 24.3.0 (OK)
nbconvert >=4.0 : 7.12.0 (OK)
numpydoc >=0.6.0 : 1.6.0 (OK)
paramiko >=2.4.0 : 3.3.1 (OK)
parso >=0.7.0,<0.9.0 : 0.8.3 (OK)
pexpect >=4.4.0 : 4.9.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=5.3 : 5.9.7 (OK)
pygments >=2.0 : 2.17.2 (OK)
pylint >=2.5.0,<3.0 : 2.17.7 (OK)
pylint_venv >=3.0.2 : 3.0.3 (OK)
pyls_spyder >=0.4.0 : 0.4.0 (OK)
pylsp >=1.7.4,<1.8.0 : 1.7.4 (OK)
pylsp_black >=1.2.0,<3.0.0 : 1.3.0 (OK)
qdarkstyle >=3.0.2,<3.2.0 : 3.1 (OK)
qstylizer >=0.2.2 : 0.2.2 (OK)
qtawesome >=1.2.1 : 1.3.0 (OK)
qtconsole >=5.4.2,<5.5.0 : 5.4.4 (OK)
qtpy >=2.1.0 : 2.4.1 (OK)
rtree >=0.9.7 : 1.1.0 (OK)
setuptools >=49.6.0 : 68.2.2 (OK)
sphinx >=0.6.6 : 7.2.6 (OK)
spyder_kernels >=2.4.4,<2.5.0 : 2.4.4 (OK)
textdistance >=4.2.0 : 4.6.0 (OK)
three_merge >=0.1.1 : 0.1.1 (OK)
watchdog >=0.10.3 : 3.0.0 (OK)
zmq >=22.1.0 : 25.1.2 (OK)
# Optional:
cython >=0.21 : None (NOK)
matplotlib >=3.0.0 : 3.8.2 (OK)
numpy >=1.7 : 1.26.2 (OK)
pandas >=1.1.1 : 2.1.4 (OK)
scipy >=0.17.0 : 1.11.4 (OK)
sympy >=0.7.3 : None (NOK)
Hi @Chuck321123 thank you for the video and the example code! I think I was able to reproduce this, in fact seems like from column 41 things start to work strangely if you try to use the column header to order entries or even try to resize the column. My guess is that something is happening inside the logic that handles fetching more data when scrolling vs interacting with the new fetched information (since column 40 seems like the last column loaded by default for the example code) 🤔
What do you think @ccordoba12 @jitseniesen ?
I had a look at what this looks like in the upcoming 6.0 release and there is another issue: the scrollbars have disappeared. This bug was introduced when I added the Refresh functionality. I'll have a look at what is going on and see what we can do about both the scrollbars and the issues mentioned in the original report.