Пример #1
0
    def test_strftime_nat(self):
        # GH 29578
        arr = DatetimeArray(DatetimeIndex(["2019-01-01", pd.NaT]))

        result = arr.strftime("%Y-%m-%d")
        expected = np.array(["2019-01-01", np.nan], dtype=object)
        tm.assert_numpy_array_equal(result, expected)
Пример #2
0
    def test_strftime(self, datetime_index):
        arr = DatetimeArray(datetime_index)

        result = arr.strftime("%Y %b")
        expected = np.array([ts.strftime("%Y %b") for ts in arr], dtype=object)
        tm.assert_numpy_array_equal(result, expected)
Пример #3
0
    def test_strftime(self, datetime_index):
        arr = DatetimeArray(datetime_index)

        result = arr.strftime("%Y %b")
        expected = np.array(datetime_index.strftime("%Y %b"))
        tm.assert_numpy_array_equal(result, expected)