Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in DataViewer filter for numbers #1150

Closed
bitagoras opened this issue Oct 12, 2019 · 6 comments
Closed

Bug in DataViewer filter for numbers #1150

bitagoras opened this issue Oct 12, 2019 · 6 comments

Comments

@bitagoras
Copy link

Environment data

  • VS Code version: 1.39.1
  • Extension version: 2019.10.41019 (8 October 2019)
  • Python version: Anaconda for Python 3.7.3 64-bit

Expected behaviour

Entering e.g. "3" in colum filter for integer numpy array should result in e.g. rows with -3, -3, 3, 13, 23.

Actual behaviour

Displayed are the rows e. g. -3, -3, 0, 0, 3, 13, 23. This is a bug since zeros should be filtered. With floating point arrays the filtering seem not to work at all when expecting string pattern matching. All rows are filtered for any digits.

Screenshot

filter

Another remark on the screenshot: It would be nice, if the sorting would be stable. For several identical lines the other lines should stay in the order of the last sorted column (here the last sorted column was the line index which is now disordered for equal elements in column 1)

@rchiodo
Copy link
Contributor

rchiodo commented Oct 15, 2019

Thanks for the bug.

Do you have an example of the floating point arrays not working? I think your saying it's just doing a string filter (which is what I'd expect from anything other than a number)

It would be nice, if the sorting would be stable

Multiple column sorting will probably be done by the user picking columns while holding down the control key.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 15, 2019

The problem with the 3 matching is weird. That only happens on a column that isn't identified as a number (which it looks like you have based on the left justification)

But the zero isn't actually a value in the data as far as I can tell. It must be matching null.

@bitagoras
Copy link
Author

It seems there is value matching for float columns and pattern matching for integers (except the zero). Here are figures for float tables:
filterrow0
filterrow1
filterrow2
It should be rather the opposite. I would more prefer pattern matching (i.e. sub-pattern matching) for both types. In case numbers should be treated by their values it would make sense if you could enter intervals like "3.1 - 5.5".

@rchiodo
Copy link
Contributor

rchiodo commented Oct 15, 2019

It's only pattern matching for integers if your data doesn't specify the column type. Value matching should be the default for everything we think is a number.

You can also use > and < signs for value matching. We have yet to do ranges, but that's a good suggestion.

@bitagoras
Copy link
Author

That's a usefull feature with > and <. I didn't know. In this case I am fine with value matching for floats.
Floats then do not have any bug. Especially zeros do not match with every pattern. That's only a problem for integers.

@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 13, 2020
@IanMatthewHuff
Copy link
Member

I believe that the dataviewer changes from Vandy has resolved this issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants