Column.shift
Series shift(long n)Keeps the elements whose mask entry is true; a null mask entry counts as false.
Parameters
mask | a BOOLEAN Series of the same length |
Returns
Throws
length differs. Membership against another Series (ADR-2026-10-23-08): BOOLEAN per slot, in input order. Null input slots stay null regardless of the set; non-null slots match under the library's total equality (NaN equals NaN, -0.0 equals 0.0) with every hash candidate re-verified - collisions can never become false matches. Set nulls and duplicates are irrelevant.
Params: set_ = the candidate values (any chunking)
Returns: the BOOLEAN membership Series.
Throws: DataFrameException when the dtypes differ (no implicit cast, the join convention). Shifts the Series by n positions (ADR-2026-10-23-08): positive n delays, negative advances; vacated slots are null; never wraps around (this is not np.roll); |n| >= length yields all-null; length and dtype are preserved; any dtype.
Params: n = the shift amount
Returns: the shifted Series.