Skip to content

Commit 73c0990

Browse files
winklerandjreback
authored andcommitted
CLN: use memb._isnan for NaT masking
1 parent 4b1c740 commit 73c0990

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

pandas/core/resample.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,17 +1272,8 @@ def _get_period_bins(self, ax):
12721272
# NaT handling as in pandas._lib.lib.generate_bins_dt64()
12731273
nat_count = 0
12741274
if memb.hasnans:
1275-
import warnings
1276-
with warnings.catch_warnings():
1277-
warnings.filterwarnings('ignore', 'numpy equal will not check '
1278-
'object identity')
1279-
nat_mask = memb.base == tslib.NaT
1280-
# raises "FutureWarning: numpy equal will not check object
1281-
# identity in the future. The comparison did not return the
1282-
# same result as suggested by the identity (`is`)) and will
1283-
# change."
1284-
nat_count = np.sum(nat_mask)
1285-
memb = memb[~nat_mask]
1275+
nat_count = np.sum(memb._isnan)
1276+
memb = memb[~memb._isnan]
12861277

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

0 commit comments

Comments
 (0)