-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
API: Clean up dtypes/common.py #16242
Comments
this is likely not desired. These are for unknown array-like only (e.g. Index,ndarray,Series), which can simply be introspected with NO computation. IOW anything that needs element-by-element detection is a no-no here. |
can you post the TODO's here. |
I'm confused, something like: def is_*_dtype(arr_or_dtype):
if is_list_like(arr_or_dtype) and not hasattr(arr_or_dtype, dtype):
arr_or_dtype = np.asarray(arr_or_dtype)
... |
I edited the original issue to add them. |
Should Period be an instance of PeriodDtype? yes but these would require quite some work |
What do you mean? |
welll see what happens when you store a PeriodIndex as a column |
@gfyoung closeable? most of the topics mentioned in the OP look like they've been handled |
Yup I think all the initial issues have been address so closing. We can open follow up issues targeting specific function if still necessary |
When I was developing #16237, I noticed that the API for checking
dtype
is quite messy. We appear to have duplicate functionality, and the interface is not clear as to what we should accept.I propose that for all such
dtype
checking functions, we should accept ANY array-like and ANYdtype
ORtype
object and cast anylist
-like object tonp.array
.Also, I added several
TODO
in that same file that I was hoping to get some feedback on. They stood out to me because they seemed either non-intuitive OR symptomatic of the API redundancy that I was referring to.is_datetimetz
seems like a duplicate ofis_datetime64tz_dtype
. Do we need it?is_period
seems like a duplicate ofis_period_arraylike
. Do we need it?Period
be an instance ofPeriodDtype
?Interval
be an instance ofIntervalDtype
?The text was updated successfully, but these errors were encountered: