rapidsai / cudf

cuDF - GPU DataFrame Library
https://docs.rapids.ai/api/cudf/stable/
Apache License 2.0
8.4k stars 898 forks source link

[FEA] Add support for `Frame.attrs` #15606

Open galipremsagar opened 6 months ago

galipremsagar commented 6 months ago

Is your feature request related to a problem? Please describe. We will need to add support for Frame.attrs: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.attrs.html, and be able to properly round-trip the values to and from pandas.

Matt711 commented 3 months ago

It looks like attrs are supported in 24.08. cc. @galipremsagar

Matt711 commented 3 months ago

be able to properly round-trip the values to and from pandas.

Can you elaborate on what you mean by this?

galipremsagar commented 3 months ago

be able to properly round-trip the values to and from pandas.

Can you elaborate on what you mean by this?

This is what I meant:

In [1]: %load_ext cudf.pandas

In [2]: import pandas as pd

In [3]: ser = pd.Series([1, 2, 3])

In [4]: ser
Out[4]: 
0    1
1    2
2    3
dtype: int64

In [5]: ser.attrs = {"A": [10, 20, 30]}

In [6]: ser
Out[6]: 
0    1
1    2
2    3
dtype: int64

In [7]: ser.attrs
Out[7]: {}