-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Add frequency to DatetimeArray/TimedeltaArray take #58382
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
BUG: Add frequency to DatetimeArray/TimedeltaArray take #58382
Conversation
19d396d
to
5440815
Compare
30a69e1
to
30be34a
Compare
195a9a5
to
e67ca27
Compare
pandas/core/indexes/multi.py
Outdated
@@ -1244,7 +1244,9 @@ def _constructor(self) -> Callable[..., MultiIndex]: # type: ignore[override] | |||
return type(self).from_tuples | |||
|
|||
@doc(Index._shallow_copy) | |||
def _shallow_copy(self, values: np.ndarray, name=lib.no_default) -> MultiIndex: | |||
def _shallow_copy( |
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.
if the options are doing this in take or shallow_copy, take is definitely preferred
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.
done -- implemented via take
d49d42c
to
b2a244a
Compare
cae8e63
to
ceb3633
Compare
4bedc39
to
9b480bf
Compare
pandas/core/arrays/datetimelike.py
Outdated
|
||
if isinstance(maybe_slice, slice): | ||
freq = self._get_getitem_freq(maybe_slice) | ||
result.freq = freq |
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 think if you set result._freq it will be more performant
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.
changed
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.
Hi @jbrockmendel is this now corresponding to your idea?
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.
Hi @jbrockmendel , any news on this? would be nice to finish the PR at some point :)
9b480bf
to
b5e228b
Compare
342ee5e
to
6a2649b
Compare
a8788a0
to
ab23100
Compare
dad1473
to
d6f0e86
Compare
fae221c
to
05e2bb6
Compare
…ray docstring make pre-commit happy
05e2bb6
to
0dd9feb
Compare
Thanks @annika-rudolph (sorry for the delay here) |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Disclaimer
I am required to add that the software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.