8000 DOC: update the Index.shift docstring by DataOmbudsman · Pull Request #20192 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

DOC: update the Index.shift docstring #20192

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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
DOC: updating docstring of Index.shift
  • Loading branch information
Arpad Fulop committed Mar 10, 2018
commit a520a9394d494d9a3b0aa5052e9a1e5d439c4aed
11 changes: 6 additions & 5 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2256,18 +2256,19 @@ def sortlevel(self, level=None, ascending=True, sort_remaining=None):
return self.sort_values(return_indexer=True, ascending=ascending)

def shift(self, periods=1, freq=None):
"""Shift index by desired number of time frequency increments.
"""
Shift index by desired number of time frequency increments.

This method is for shifting the values of datetime-like indexes
by a specified time increment a given number of times.

Parameters
----------
periods : int
periods : int, default 1
Number of periods (or increments) to shift by,
can be positive or negative (default is 1).
freq : pandas.DateOffset, pandas.Timedelta or string
Frequency increment to shift by (default is None).
can be positive or negative.
freq : pandas.DateOffset, pandas.Timedelta or string, optional
Frequency increment to shift by.
If None, the index is shifted by its own `freq` attribute.
Offset aliases are valid strings, e.g., 'D', 'W', 'M' etc.

Expand Down
0