pandas.api.extensions.ExtensionArray.shift
pandas 3.1.1 · Extensions · method
Move values by a positional offset, filling the vacated positions as requested.
Call syntax
pd.api.extensions.ExtensionArray.shift(periods=1, fill_value=None)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
periods |
Optional Positional or keyword Default 1 |
int Set a count of generated observations or the number of steps to shift or compare. |
fill_value |
Optional Positional or keyword Default None |
object Supply a value to use in place of a missing position. |
Returns
ExtensionArray