NVIDIA / NVIDIA/cudf

[BUG] Grouping by a nonexistent key gives `ValueError` rather than `KeyError`

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

Description

I would expect the code below to raise a `KeyError`, but it raises a `ValueError` instead:

```python
>>> import cudf
>>> df = cudf.DataFrame({'a': [1, 1, 2], 'b': [1, 2, 3]})
>>> df.groupby('cd').sum()
...
ValueError: Grouper and object must have same length
```

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.