-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Index dtype may not be applied properly #11017
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
Conversation
pls run perf check on this - |
@sinhrks can you see if this affects perf? |
if is_categorical_dtype(data) or is_categorical_dtype(dtype): | ||
return CategoricalIndex(data, copy=copy, name=name, **kwargs) | ||
|
||
from pandas.tseries.index import DatetimeIndex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would leave all of the imports where they were, no reason to actually import them until they are used (see below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually on 2nd thought this is fine
Following is a asv result. Will consider a better path.
|
this is prob just from the imports (e.g. a Float64Index) doesn't care about Datetimeindex, so the import adds the extra time (or the check for the import anyhow) |
ce89f9d
to
c3eaeb0
Compare
@jreback Thanks, suggested changes improve perf a little. I assume other slowness is caused by
|
master (this is
this branch
fix jreback@29c0325
will merge in a bit, thanks @sinhrks |
Wow, great. Thanks! |
merged via ead3ca8 (my change in another commit) thanks! I don't believe we had an issue assosicated, correct? |
Though this was based on gitter chat, #5196 refers to the same issue. Closed. |
@sinhrks awesome thanks! |
Fixed 2 problems:
dtype
is not applied to other iterables.category
to ndarray-like results inTypeError