Skip to content

Commit

Permalink
handles case when periods > len(df)
Browse files Browse the repository at this point in the history
  • Loading branch information
skirui-source committed Feb 17, 2022
1 parent a4f1428 commit c264ea4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/cudf/cudf/core/column/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,12 @@ def _fill(
return self

def shift(self, offset: int, fill_value: ScalarLike) -> ColumnBase:
# link to the libcudf ticket you will create
if abs(offset) > len(self):
if fill_value is None:
return column_empty_like(self, masked=True)
else:
return full(len(self), fill_value, dtype=self.dtype)
return libcudf.copying.shift(self, offset, fill_value)

@property
Expand Down

0 comments on commit c264ea4

Please sign in to comment.