コード例 #1
0
 def test_period_index_as_input(
     self,
     period_index_series: pd.Series,
     start: pd.datetime,
     freq: pd.Timedelta,
     output_name: str,
 ):
     time_series_preparation = TimeSeriesPreparation(
         start=start, freq=freq, output_name=output_name)
     computed_time_series = time_series_preparation.transform(
         period_index_series)
     expected_time_series = pd.DataFrame({output_name: period_index_series})
     assert_frame_equal(computed_time_series, expected_time_series)
コード例 #2
0
 def test_array_as_input(
     self,
     input_array: np.ndarray,
     start: datetime,
     freq: pd.Timedelta,
     output_name: str,
 ):
     time_series_preparation = TimeSeriesPreparation(
         start=start, freq=freq, output_name=output_name
     )
     computed_time_series = time_series_preparation.transform(input_array)
     expected_series = pandas_series_with_period_index(input_array, start, freq=freq)
     expected_time_series = pd.DataFrame({output_name: expected_series})
     assert_frame_equal(computed_time_series, expected_time_series)