Skip to content

Commit

Permalink
test(core): value counts on column of added / concatenated strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
JovanVeljanoski authored and maartenbreddels committed Sep 11, 2020
1 parent e4af416 commit 7784e5c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/value_counts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,14 @@ def test_value_counts_masked_str():
assert value_counts['A'] == 2
assert value_counts['B'] == 1
assert value_counts[''] == 2


def test_value_counts_add_strings():
x = ['car', 'car', 'boat']
y = ['red', 'red', 'blue']
df = vaex.from_arrays(x=x, y=y)
df['z'] = df.x + '-' + df.y

value_counts = df.z.value_counts()
assert list(value_counts.index) == ['car-red', 'boat-blue']
assert value_counts.values.tolist() == [2, 1]

0 comments on commit 7784e5c

Please sign in to comment.