We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21bc7d8 commit bed37e7Copy full SHA for bed37e7
pandas/core/generic.py
@@ -10112,13 +10112,17 @@ def mask(
10112
)
10113
10114
@doc(klass=_shared_doc_kwargs["klass"])
10115
+ if self.ndim == 1 and (prefix or suffix):
10116
+ raise ValueError("`prefix` and `suffix` are only supported on DataFrame.shift when `periods` is a list. ")
10117
def shift(
10118
self,
10119
periods: int | Sequence[int] = 1,
10120
freq=None,
10121
axis: Axis = 0,
10122
fill_value: Hashable = lib.no_default,
10123
+ prefix: str | None = None,
10124
suffix: str | None = None,
10125
+ sep: str = "_"
10126
) -> Self | DataFrame:
10127
"""
10128
Shift index by desired number of periods with an optional time `freq`.
0 commit comments