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,
            metadata=series.metadata,
        )

        Function creating the lower frequency dataframe out of a higher frequency dataframe.
        
darts/dataprocessing/transformers/midas.py