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

is_scalar should return True for DateOffset objects #18943

jbrockmendel opened this Issue Dec 26, 2017 · 2 comments


None yet
3 participants

jbrockmendel commented Dec 26, 2017

No description provided.

@jreback jreback added this to the Next Major Release milestone Dec 26, 2017


This comment has been minimized.


gitavi commented Dec 28, 2017

I am attempting this as a first issue.

I traced the is_scalar function back to its implementation which is in Cython and it uses checks imported from the CPython datetime library to check the for the listed datetime objects. DateOffset objects are specific to Pandas so what would my next steps be here? I imagine importing DateOffset from where ever it's defined and using isinstance is not the answer...


This comment has been minimized.


jreback commented Dec 28, 2017

need to add a is_offset to pandas/_libs/src/inference.pyx, then you can use this in isscalar. this would look very similar to pandas/_libs/src/util.pxd/is_period_object (you don't need to define it also in util.pxd though).

is_offset should also be imported / tested in pandas/core/dtypes/

@jreback jreback modified the milestones: Next Major Release, 0.23.0 Dec 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment