MCPcopy
hub / github.com/pandas-dev/pandas / test_isin_datetimelike_all_nat

Method test_isin_datetimelike_all_nat

pandas/tests/test_algos.py:1000–1008  ·  pandas/tests/test_algos.py::TestIsin.test_isin_datetimelike_all_nat
(self, dtype)

Source from the content-addressed store, hash-verified

998
999 @pytest.mark.parametrize(class="st">"dtype", [class="st">"m8[ns]", class="st">"M8[ns]", class="st">"M8[ns, UTC]", class="st">"period[D]"])
1000 def test_isin_datetimelike_all_nat(self, dtype):
1001 class="cm"># GH#56427
1002 dta = date_range(class="st">"2013-01-01", periods=3)._values
1003 arr = Series(dta.view(class="st">"i8")).array.view(dtype)
1004
1005 arr[0] = NaT
1006 result = algos.isin(arr, [NaT])
1007 expected = np.array([True, False, False], dtype=bool)
1008 tm.assert_numpy_array_equal(result, expected)
1009
1010 @pytest.mark.parametrize(class="st">"dtype", [class="st">"m8[ns]", class="st">"M8[ns]", class="st">"M8[ns, UTC]"])
1011 def test_isin_datetimelike_strings_returns_false(self, dtype):

Callers

nothing calls this directly

Calls 5

date_rangeFunction · 0.90
SeriesClass · 0.90
viewMethod · 0.45
isinMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected