We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
DataFrame.astype('category')
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
Weird, using v1.5.3.230227, which has that, I got this message
error: Argument 1 to "astype" of "DataFrame" has incompatible type "Literal['category']"; expected "Union[Union[Union[Type[bool], Type[bool_], BooleanDtype, Literal['bool']], Union[Type[int], Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype, Type[signedinteger[_8Bit]], Type[signedinteger[_16Bit]], Type[signedinteger[_32Bit]], Type[signedinteger[_64Bit]], Type[unsignedinteger[_8Bit]], Type[unsignedinteger[_16Bit]], Type[unsignedinteger[_32Bit]], Type[unsignedinteger[_64Bit]], Type[signedinteger[Any]], Type[unsignedinteger[Any]], Type[signedinteger[Any]], Type[unsignedinteger[Any]], Literal['int', 'int32']], Union[Type[str], StringDtype, Literal['str']], Type[bytes], Union[Float32Dtype, Float64Dtype, Type[floating[_16Bit]], Type[floating[_32Bit]], Type[floating[_64Bit]], Type[float], Literal['float']], Union[Type[complexfloating[_32Bit, _32Bit]], Type[complexfloating[_64Bit, _64Bit]], Type[complex], Literal['complex']], CategoricalDtype, ExtensionDtype, Literal['timedelta64[ns]', 'datetime64[ns]']], Mapping[Any, Union[ExtensionDtype, Union[str, dtype[generic], Type[str], Type[complex], Type[bool], Type[object]]]], Series[Any]]" [arg-type]
I guess because CategoryDtypeArg is missing from AstypeArg.
CategoryDtypeArg
AstypeArg
pandas-stubs/pandas-stubs/_typing.pyi
Lines 153 to 164 in d2faa7f
Originally posted by @zmoon in #556 (comment)
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
error: Argument 1 to "astype" of "DataFrame" has incompatible type "Literal['category']"; expected "Union[Union[Union[Type[bool], Type[bool_], BooleanDtype, Literal['bool']], Union[Type[int], Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype, Type[signedinteger[_8Bit]], Type[signedinteger[_16Bit]], Type[signedinteger[_32Bit]], Type[signedinteger[_64Bit]], Type[unsignedinteger[_8Bit]], Type[unsignedinteger[_16Bit]], Type[unsignedinteger[_32Bit]], Type[unsignedinteger[_64Bit]], Type[signedinteger[Any]], Type[unsignedinteger[Any]], Type[signedinteger[Any]], Type[unsignedinteger[Any]], Literal['int', 'int32']], Union[Type[str], StringDtype, Literal['str']], Type[bytes], Union[Float32Dtype, Float64Dtype, Type[floating[_16Bit]], Type[floating[_32Bit]], Type[floating[_64Bit]], Type[float], Literal['float']], Union[Type[complexfloating[_32Bit, _32Bit]], Type[complexfloating[_64Bit, _64Bit]], Type[complex], Literal['complex']], CategoricalDtype, ExtensionDtype, Literal['timedelta64[ns]', 'datetime64[ns]']], Mapping[Any, Union[ExtensionDtype, Union[str, dtype[generic], Type[str], Type[complex], Type[bool], Type[object]]]], Series[Any]]" [arg-type]
I guess because
CategoryDtypeArg
is missing fromAstypeArg
.pandas-stubs/pandas-stubs/_typing.pyi
Lines 153 to 164 in d2faa7f
Originally posted by @zmoon in #556 (comment)
The text was updated successfully, but these errors were encountered: