-
-
Notifications
You must be signed in to change notification settings - Fork 141
Fix Series.astype() to return a Series[type] dependent on argument #372
New issue
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
Comments
So we just have to change the return type to |
No, it's more nuanced than that, because you can pass strings to I'd suggest making a table of values of There might be cases where there is no possible value for the |
i'll get started with it now then |
* adding overloads to astype * Created the table for astype * Update table.rst * Updated the table and added numpy dtypes * Update table.rst * updated np.datetime64 * Update table.rst * added types in Timedelta * removed not required args in Dtype * removed np.timedelta64 in Timedelta * Removed timedelta64 * expanding series astype * Added type in args in dtype * corrected the args * adding a overload for 'category' and normal changes * added tests * removed unused args * corrected tests * Delete table.rst * added the bool overload to top and done the required test changes * added type_checker * added types for check and did requested changes * updated the check types * added astype in dataframe and other changes * Update test_series.py * Update test_series.py * added dict test for astype in datatest_frame and tests for ExtensionDtype in test_series * commented out the decimal tests * Update test_series.py * updated dtype args in astype * added any to list of args for astype * changed dtype args
* adding overloads to astype * Created the table for astype * Update table.rst * Updated the table and added numpy dtypes * Update table.rst * updated np.datetime64 * Update table.rst * added types in Timedelta * removed not required args in Dtype * removed np.timedelta64 in Timedelta * Removed timedelta64 * expanding series astype * Added type in args in dtype * corrected the args * adding a overload for 'category' and normal changes * added tests * removed unused args * corrected tests * Delete table.rst * added the bool overload to top and done the required test changes * added type_checker * added types for check and did requested changes * updated the check types * added astype in dataframe and other changes * Update test_series.py * Update test_series.py * added dict test for astype in datatest_frame and tests for ExtensionDtype in test_series * commented out the decimal tests * Update test_series.py * updated dtype args in astype * added any to list of args for astype * changed dtype args
Deprecations in 1.5 on
Series.astype()
revealed that we have to work on that method.See #227 (comment)
Ideally, things like
s.astype(int)
ands.astype("int")
would both returnSeries[int]
. Have to deal with each of the possible types, as well as the possible strings.The text was updated successfully, but these errors were encountered: