Skip to content

Commit

Permalink
using pandas is_integer() and float() instead
Browse files Browse the repository at this point in the history
  • Loading branch information
skirui-source committed Jan 26, 2022
1 parent 2abbd2e commit e0722ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from numba import cuda
from nvtx import annotate
from pandas._config import get_option
from pandas.core.dtypes.common import is_float, is_integer
from pandas.io.formats import console
from pandas.io.formats.printing import pprint_thing

Expand All @@ -33,7 +34,6 @@
is_datetime_dtype,
is_dict_like,
is_dtype_equal,
is_integer,
is_list_dtype,
is_list_like,
is_numeric_dtype,
Expand Down Expand Up @@ -2653,7 +2653,7 @@ def diff(self, periods=1, axis=0):
"""
if not is_integer(periods):
if not (isinstance(periods, float) and isinstance(periods, int)):
if not (is_float(periods) and periods.is_integer()):
raise ValueError("periods must be an integer")
periods = int(periods)

Expand Down

0 comments on commit e0722ae

Please sign in to comment.