-
-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
DOC: Add example of NonFixedVariableWindowIndexer usage #34994
DOC: Add example of NonFixedVariableWindowIndexer usage #34994
Conversation
|
||
.. code-block:: ipython | ||
|
||
In [1]: from pandas.core.window.indexers import NonFixedVariableWindowIndexer |
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.
can you make an ipython block? (e..g execute the code)
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.
Wasn't sure if we wanted to advertise importing from core since we want to make that private eventually, but can do nonetheless.
@@ -594,6 +594,32 @@ and we want to use an expanding window where ``use_expanding`` is ``True`` other | |||
4 10.0 | |||
|
|||
You can view other examples of ``BaseIndexer`` subclasses `here <https://github.com/pandas-dev/pandas/blob/master/pandas/core/window/indexers.py>`__ | |||
One subclass of note within those examples is the ``NonFixedVariableWindowIndexer`` that allows |
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.
would add a versionadded tag 1.1
In [1]: from pandas.core.window.indexers import NonFixedVariableWindowIndexer | ||
|
||
In [2]: df = pd.DataFrame(range(10), index=pd.date_range('2020', periods=10)) | ||
|
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.
show df here
…indowindexer_example
…indowindexer_example
|
||
.. ipython:: python | ||
|
||
from pandas.core.window.indexers import NonFixedVariableWindowIndexer |
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.
are we adding this to pandas.api.indexers? (i think ok to do this)
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.
Sure I can go ahead and add it to pandas.api.indexers
. I think it's worth exposing
|
||
__all__ = ["check_array_indexer", "BaseIndexer", "FixedForwardWindowIndexer"] | ||
__all__ = [ |
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.
can you add a test for this in test_api (followon ok)
@@ -597,6 +597,18 @@ You can view other examples of ``BaseIndexer`` subclasses `here <https://github. | |||
|
|||
.. versionadded:: 1.1 | |||
|
|||
One subclass of note within those examples is the ``NonFixedVariableWindowIndexer`` that allows |
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.
we should rename this Indexer, its a bit redundant (NonFixedVariable)......followon ok
thanks a couple of followons noted |
xref #34947 (comment)