docstr: Function creating the lower frequency dataframe out of a higher frequency dataframe.
docstr_tok: ["Function","creating","the","lower","frequency","dataframe","out","of","a","higher","frequency","dataframe","."]
code: def _create_midas_df(
      series: TimeSeries,
      arr: np.ndarray,
      time_index: Union[pd.DatetimeIndex, pd.RangeIndex],
      n_midas: int,
      drop_static_covariates: bool,
      inverse_transform: bool,
      feature_sep: str,
  ) -> TimeSeries:
      """
      Function creating the lower frequency dataframe out of a higher frequency dataframe.
      """
      if not inverse_transform:
          cols = [
              f"{col}{feature_sep}{i}"
              for i in range(n_midas)
              for col in series.columns
          ]
      else:
          cols_orig = series.n_components // n_midas
          cols = (
              series.components[:cols_orig]
              .str.split(feature_sep)
              .str[0]
              .tolist()
          )
  
      static_covariates = MIDAS._process_static_covariates(
          series=series,
          n_midas=n_midas,
          drop_static_covariates=drop_static_covariates,
          inverse_transform=inverse_transform,
      )
      return TimeSeries.from_times_and_values(
          times=time_index,
          values=arr,
          columns=cols,
          static_covariates=static_covariates,
      )
  
file_path: darts/darts/dataprocessing/transformers/midas.py
imports: from typing import Any, Dict, List, Mapping, Optional, Sequence, Union
  import numpy
  import pandas
  from darts import TimeSeries
  from darts.dataprocessing.transformers import FittableDataTransformer, InvertibleDataTransformer
  from darts.logging import get_logger, raise_log
  from darts.timeseries import _finite_rows_boundaries
  from darts.utils.timeseries_generation import generate_index
label_desc: Use image node_id 7 for calling the MIDAS obj's underlying member method code with example usage: obj._create_midas_df(series, arr, time_index, n_midas, drop_static_covariates, inverse_transform, feature_sep) and returns: TimeSeries