NVIDIA / NVIDIA/cudf

[FEA] cuDF doesn’t support custom class objects as columns

Open
#5,546 1 comment 0 reactions 0 assignees View on GitHub
feature request Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
cuDF doesn’t support custom class objects as columns

**Describe the solution you'd like**
Add support for custom class objects to be used as columns

**Describe alternatives you've considered**
Use strings instead

**Additional context**

Pandas sample
```python

import pandas as pd

class Header:
def __init__(self, name):
self.name = name

pd.DataFrame({Header("name"): [1, 2, 3]})
```

cuDF sample
```python
import cudf as pd

pd.DataFrame({Header("name"): [1, 2, 3]})
# TypeError: __setitem__ on type is not supported

```

Traceback:
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)

~/miniconda3/envs/rapids14/lib/python3.7/site-packages/cudf/core/dataframe.py in __setitem__(self, arg, value)
616 else:
617 msg = "__setitem__ on type {!r} is not supported"
--> 618 raise TypeError(msg.format(type(arg)))
619
620 def __delitem__(self, name):

TypeError: __setitem__ on type is not supported

```

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.