We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cudf.NA
In Pandas, I can do the following:
import pandas as pd x = pd.DataFrame({'a':[1,2,3]}) x['b'] = pd.NA x a b 0 1 <NA> 1 2 <NA> 2 3 <NA>
However, with cuDF I get the following error:
import cudf x = cudf.DataFrame({'a':[1,2,3]}) x['b'] = cudf.NA --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /tmp/ipykernel_33816/3347028048.py in <module> 1 import pandas as pd 2 ----> 3 x['b'] = cudf.NA ~/miniconda3/envs/cudf_dev/lib/python3.8/contextlib.py in inner(*args, **kwds) 73 def inner(*args, **kwds): 74 with self._recreate_cm(): ---> 75 return func(*args, **kwds) 76 return inner 77 ~/miniconda3/envs/cudf_dev/lib/python3.8/site-packages/cudf/core/dataframe.py in __setitem__(self, arg, value) 764 # disc. with pandas here 765 # pandas raises key error here --> 766 self.insert(len(self._data), arg, value) 767 768 elif can_convert_to_column(arg): ~/miniconda3/envs/cudf_dev/lib/python3.8/contextlib.py in inner(*args, **kwds) 73 def inner(*args, **kwds): 74 with self._recreate_cm(): ---> 75 return func(*args, **kwds) 76 return inner 77 ~/miniconda3/envs/cudf_dev/lib/python3.8/site-packages/cudf/core/dataframe.py in insert(self, loc, name, value) 3080 3081 if _is_scalar_or_zero_d_array(value): -> 3082 value = utils.scalar_broadcast_to(value, len(self)) 3083 3084 if len(self) == 0: ~/miniconda3/envs/cudf_dev/lib/python3.8/site-packages/cudf/utils/utils.py in scalar_broadcast_to(scalar, size, dtype) 69 70 scalar = to_cudf_compatible_scalar(scalar, dtype=dtype) ---> 71 dtype = scalar.dtype 72 73 if np.dtype(dtype).kind in ("O", "U"): AttributeError: 'NAType' object has no attribute 'dtype'
The text was updated successfully, but these errors were encountered:
NA
Inserting a cudf.NA into a DataFrame (#8923)
b17024e
Addressing #8922 - just have to check if it's a `cudf.NA` and set to `None` if necessary. Authors: - Sarah Yurick (https://github.com/sarahyurick) Approvers: - https://github.com/brandon-b-miller - Ram (Ramakrishna Prabhu) (https://github.com/rgsl888prabhu) URL: #8923
sarahyurick
Successfully merging a pull request may close this issue.
In Pandas, I can do the following:
However, with cuDF I get the following error:
The text was updated successfully, but these errors were encountered: