def test_strftime_nat(self): # GH 29578 arr = PeriodArray(PeriodIndex(["2019-01-01", NaT], dtype="period[D]")) result = arr.strftime("%Y-%m-%d") expected = np.array(["2019-01-01", np.nan], dtype=object) tm.assert_numpy_array_equal(result, expected)
def test_strftime(self, period_index): arr = PeriodArray(period_index) result = arr.strftime("%Y") expected = np.array([per.strftime("%Y") for per in arr], dtype=object) tm.assert_numpy_array_equal(result, expected)
def test_strftime(self, period_index): arr = PeriodArray(period_index) result = arr.strftime("%Y") expected = np.array(period_index.strftime("%Y")) tm.assert_numpy_array_equal(result, expected)