Skip to content

Commit

Permalink
Add separate DatetimeIndex.repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
galipremsagar committed May 14, 2024
1 parent 2161d35 commit 48e2cc5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/cudf/cudf/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1521,12 +1521,9 @@ def argsort(
)

def repeat(self, repeats, axis=None):
res = self._from_columns_like_self(
return self._from_columns_like_self(
Frame._repeat([*self._columns], repeats, axis), self._column_names
)
if isinstance(res, DatetimeIndex):
res._freq = None
return res

@_cudf_nvtx_annotate
def where(self, cond, other=None, inplace=False):
Expand Down Expand Up @@ -2376,6 +2373,11 @@ def tz_convert(self, tz: str | None):
result_col = self._column.tz_convert(tz)
return DatetimeIndex._from_data({self.name: result_col})

def repeat(self, repeats, axis=None):
res = super().repeat(repeats, axis=axis)
res._freq = None
return res


class TimedeltaIndex(Index):
"""
Expand Down

0 comments on commit 48e2cc5

Please sign in to comment.