Skip to content

Commit 0c9f135

Browse files
committed
CLN: use memb._isnan for NaT masking
1 parent 9e46e13 commit 0c9f135

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

pandas/core/resample.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -1222,17 +1222,8 @@ def _get_period_bins(self, ax):
12221222
# NaT handling as in pandas._lib.lib.generate_bins_dt64()
12231223
nat_count = 0
12241224
if memb.hasnans:
1225-
import warnings
1226-
with warnings.catch_warnings():
1227-
warnings.filterwarnings('ignore', 'numpy equal will not check '
1228-
'object identity')
1229-
nat_mask = memb.base == tslib.NaT
1230-
# raises "FutureWarning: numpy equal will not check object
1231-
# identity in the future. The comparison did not return the
1232-
# same result as suggested by the identity (`is`)) and will
1233-
# change."
1234-
nat_count = np.sum(nat_mask)
1235-
memb = memb[~nat_mask]
1225+
nat_count = np.sum(memb._isnan)
1226+
memb = memb[~memb._isnan]
12361227

12371228
# if index contains no valid (non-NaT) values, return empty index
12381229
if not len(memb):

0 commit comments

Comments
 (0)