Skip to content
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

Merged

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke added the Docs label Jun 25, 2020
@jreback jreback added this to the 1.1 milestone Jun 25, 2020
@jreback jreback added the Window rolling, ewma, expanding label Jun 25, 2020

.. code-block:: ipython

In [1]: from pandas.core.window.indexers import NonFixedVariableWindowIndexer
Copy link
Contributor

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)

Copy link
Member Author

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
Copy link
Contributor

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))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

show df here


.. ipython:: python

from pandas.core.window.indexers import NonFixedVariableWindowIndexer
Copy link
Contributor

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)

Copy link
Member Author

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__ = [
Copy link
Contributor

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
Copy link
Contributor

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

@jreback jreback merged commit bce11e2 into pandas-dev:master Jun 29, 2020
@jreback
Copy link
Contributor

jreback commented Jun 29, 2020

thanks a couple of followons noted

@mroeschke mroeschke deleted the nonfixedvariablewindowindexer_example branch June 30, 2020 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Window rolling, ewma, expanding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants