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
Related to #8885.
I am able to cast to Pandas' boolean dtype with:
import cudf import pandas as pd s = cudf.Series([1, 2, 0]) s.astype(pd.BooleanDtype()) 0 True 1 True 2 False dtype: bool
However, the string name "boolean" for the BooleanDtype is not supported:
s.astype("boolean") --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /tmp/ipykernel_26633/182000827.py in <module> 4 s = cudf.Series([1, 2, 3]) 5 s.astype(pd.BooleanDtype()) ----> 6 s.astype("boolean") ~/miniconda3/envs/cudf_dev/lib/python3.8/site-packages/cudf/core/series.py in astype(self, dtype, copy, errors) 3114 except Exception as e: 3115 if errors == "raise": -> 3116 raise e 3117 elif errors == "warn": 3118 import traceback ~/miniconda3/envs/cudf_dev/lib/python3.8/site-packages/cudf/core/series.py in astype(self, dtype, copy, errors) 3106 try: 3107 print(dtype) -> 3108 data = self._column.astype(dtype) 3109 3110 return self._copy_construct( ~/miniconda3/envs/cudf_dev/lib/python3.8/site-packages/cudf/core/column/column.py in astype(self, dtype, **kwargs) 884 dtype = pandas_dtypes_to_cudf_dtypes.get(dtype, dtype) 885 if _is_non_decimal_numeric_dtype(dtype): --> 886 return self.as_numerical_column(dtype, **kwargs) 887 elif is_categorical_dtype(dtype): 888 return self.as_categorical_column(dtype, **kwargs) ~/miniconda3/envs/cudf_dev/lib/python3.8/site-packages/cudf/core/column/numerical.py in as_numerical_column(self, dtype, **kwargs) 254 255 def as_numerical_column(self, dtype: Dtype, **kwargs) -> NumericalColumn: --> 256 dtype = np.dtype(dtype) 257 if dtype == self.dtype: 258 return self TypeError: data type 'boolean' not understood
The text was updated successfully, but these errors were encountered:
Similar to #8915.
Sorry, something went wrong.
Support casting with Pandas dtype aliases (#8920)
c5a575c
Addressing #8904. Note that it does not include the "string" alias because we already have `as_string_column`. Authors: - Sarah Yurick (https://github.com/sarahyurick) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) URL: #8920
Fixed by #8920
sarahyurick
Successfully merging a pull request may close this issue.
Related to #8885.
I am able to cast to Pandas' boolean dtype with:
However, the string name "boolean" for the BooleanDtype is not supported:
The text was updated successfully, but these errors were encountered: