When opening a dictionary of dataframes from the Variable explorer, the sizes and values do not match the actual data. Specifically, when I start sorting the keys, one can see that the sizes are not sorted correctly:
I get this problem even before "sorting" the dictionary, because when opening the dictionary the keys by default are displayed alphabetically and not in the actual insertion order.
However, I do not have this problem with dicts of small dfs. E.g., sorting this one works perfectly fine:
directors = {}
directors["A"] = pd.DataFrame({"A": "joe","A2": "biden"}, index=[0])
directors["B"] = pd.DataFrame({"B": "don","B2": "trump"}, index=[0])
directors["C"] = pd.DataFrame({"C": "anderson","C2": "cooper"}, index=[0])
directors["D"] = pd.DataFrame({"D": "katie","D2": "hobbs"}, index=[0])
Hey @skalierer, thanks for reporting. I think this was already fixed by @skjerns and it'll be available in our 4.2.0 version, to be available in the net few days.
@skjerns, could you confirm that?
this should be fixed indeed, unless this issue is different from #13733 which I cannot check without code
Apologies for not having found #13733 myself! This looks like the fix I was looking for. Thank you for your efforts!
I'm currently using 4.2.0 and see a similar issue.
Steps to reproduce:
var = {'a_len=4': [1,2,3,4], 'b_len=8': [1,2,3,4,5,6,7,8], 'c_len=5': [1,2,3,4,5]}
As the problem only ocurred when sorting in the reverse direction, I quickly tracked it down to the line
https://github.com/spyder-ide/spyder/blob/436290ba71bb16c5928676467a358b70f4f38c10/spyder/plugins/variableexplorer/widgets/collectionseditor.py#L288
It is missing a keyword argument "reverse=reverse". (Verified by editing my local files.)
I could make a pull request with this change. Would branch 4.x be the right place to put it?
Hey @hengin, thanks for tracking that problem down! A pull request against 4.x is the right thing to do too. Thanks for your help!
Hello @ccordoba12, thanks for responding so quickly! I see GitHub has already linked my pull request, so I guess I'm only commenting here to show my appreciation :+1: