NVIDIA / NVIDIA/cudf

[BUG] DataFrame.query binary-ops do not match pandas

Open
#12,568 4 comments 0 reactions 0 assignees View on GitHub
0 - Backlog bug Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Describe the bug**
using `import cudf as pd`

**Steps/Code to reproduce bug**
```
In [1]: import cudf as pd

In [2]: pd.__version__
Out[2]: '22.12.00'

In [3]: df = pd.DataFrame({"A": ["foo", "foo", "foo", "foo", "foo",
...: "bar", "bar", "bar", "bar"],
...: "B": ["one", "one", "one", "two", "two",
...: "one", "one", "two", "two"],
...: "C": ["small", "large", "large", "small",
...: "small", "large", "small", "small",
...: "large"],
...: "D": [1, 2, 2, 3, 3, 4, 5, 6, 7],
...: "E": [2, 4, 5, 5, 6, 6, 8, 9, 9]})

In [4]: df.query("D > 5 & E > 5")
Out[4]:
Empty DataFrame
Columns: [A, B, C, D, E]
Index: []

In [5]: df.to_pandas().query("D > 5 & E > 5")
Out[5]:
A B C D E
7 bar two small 6 9
8 bar two large 7 9

In [6]: df.query("D > 5 | E > 5")
Out[6]:
Empty DataFrame
Columns: [A, B, C, D, E]
Index: []

In [7]: df.to_pandas().query("D > 5 | E > 5")
Out[7]:
A B C D E
4 foo two small 3 6
5 bar one large 4 6
6 bar one small 5 8
7 bar two small 6 9
8 bar two large 7 9
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.