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

Method test_array_tz

pandas/tests/arrays/test_datetimelike.py:716–735  ·  view source on GitHub ↗
(self, arr1d)

Source from the content-addressed store, hash-verified

714 tm.assert_numpy_array_equal(result, expected)
715
716 def test_array_tz(self, arr1d):
717 # GH#23524
718 arr = arr1d
719 dti = self.index_cls(arr1d, copy=False)
720 copy_false = None if np_version_gt2 else False
721
722 expected = dti.asi8.view("M8[ns]")
723 result = np.array(arr, dtype="M8[ns]")
724 tm.assert_numpy_array_equal(result, expected)
725
726 result = np.array(arr, dtype="datetime64[ns]")
727 tm.assert_numpy_array_equal(result, expected)
728
729 # check that we are not making copies when setting copy=copy_false
730 result = np.array(arr, dtype="M8[ns]", copy=copy_false)
731 assert result.base is expected.base
732 assert result.base is not None
733 result = np.array(arr, dtype="datetime64[ns]", copy=copy_false)
734 assert result.base is expected.base
735 assert result.base is not None
736
737 def test_array_i8_dtype(self, arr1d):
738 arr = arr1d

Callers

nothing calls this directly

Calls 2

viewMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected