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

Fix: count with binning using multiple selections #2152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/count_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ def test_count_2d():
assert list(binned_values.shape) == [32, 32]


@pytest.mark.parametrize('limits', [None, 'minmax', '95%', [-3, 3]])
def test_count_multiple_selections(limits):
df = vaex.example()
binned_values = df.count(binby=[df.x, df.y], shape=32, limits=limits, selection=['x > 0', 'y > 0'])
assert list(binned_values.shape) == [2, 32, 32]


@pytest.mark.parametrize('limits', ['minmax', '68.2%', '99.7%', '100%'])
def test_count_1d_verify_against_numpy(ds_local, limits):
df = ds_local
Expand Down