docstr: Check that multivariate monthly to quarterly with missing data in the middle is properly transformed.
docstr_tok: ["Check","that","multivariate","monthly","to","quarterly","with","missing","data","in","the","middle","is","properly","transformed","."]
code: def test_ts_with_missing_data(self):
      """
      Check that multivariate monthly to quarterly with missing data in the middle is properly transformed.
      """
      stacked_monthly_ts_missing = self.monthly_ts.stack(
          TimeSeries.from_times_and_values(
              times=self.monthly_ts.time_index,
              values=np.array(
                  [10, 11, 12, np.nan, np.nan, 15, 16, 17, 18]
              ),
              columns=["other"],
          )
      )
  
      # components are interleaved
      expected_quarterly_ts = TimeSeries.from_times_and_values(
          times=self.quarterly_ts.time_index,
          values=np.array(
              [
                  [1, 10, 2, 11, 3, 12],
                  [4, np.nan, 5, np.nan, 6, 15],
                  [7, 16, 8, 17, 9, 18],
              ]
          ),
          columns=[
              "values_midas_0",
              "other_midas_0",
              "values_midas_1",
              "other_midas_1",
              "values_midas_2",
              "other_midas_2",
          ],
      )
  
      midas_1 = MIDAS(low_freq="QS")
      multivar_quarterly_ts_midas = midas_1.fit_transform(
          stacked_monthly_ts_missing
      )
      assert multivar_quarterly_ts_midas == expected_quarterly_ts
  
      multivar_inversed_quarterly_ts_midas = midas_1.inverse_transform(
          multivar_quarterly_ts_midas
      )
      assert (
          stacked_monthly_ts_missing
          == multivar_inversed_quarterly_ts_midas
      )
  
imports: import numpy
  import pandas
  import pytest
  from darts import TimeSeries
  from darts.dataprocessing.transformers import MIDAS
  from darts.models import LinearRegressionModel
  from darts.utils.timeseries_generation import generate_index, linear_timeseries
label_desc: Use image node_id 7 for calling the TestMIDAS obj's underlying member method code with example usage: obj.test_ts_with_missing_data() without return types