def make_namedtuple(self, schema, ngram_as_dicts):
        """Converts a ngram structure where mapped values are dictionaries to a mapped structure where mapped values
        are namedtuples.

        Example:

        >>> { -1 : {'f1': 10, 'f2': 20},
        >>>    0 : {'f1': 30},
        >>> }

        is converted to

        >>> { -1 : namedtuple(f1=10, f2=20),
        >>>    0 : namedtuple(f1=30),
        >>> }

        :param schema: schema used for conversion
        :param ngram_as_dicts: ngram in the timestamp-to-dict mapping
        :return: ngram in the timestamp-to-namedtuple mapping
        """
        ngram_as_tuples = {}
        for timestamp in ngram_as_dicts.keys():
            data_as_dict = ngram_as_dicts[timestamp]
            current_schema = self.get_schema_at_timestep(schema=schema, timestep=timestamp)
            ngram_as_tuples[timestamp] = current_schema.make_namedtuple(**data_as_dict)
        return ngram_as_tuples
Converts a ngram structure where mapped values are dictionaries to a mapped structure where mapped values
        are namedtuples.

        Example:

        >>> { -1 : {'f1': 10, 'f2': 20},
        >>>    0 : {'f1': 30},
        >>> }

        is converted to

        >>> { -1 : namedtuple(f1=10, f2=20),
        >>>    0 : namedtuple(f1=30),
        >>> }

        :param schema: schema used for conversion
        :param ngram_as_dicts: ngram in the timestamp-to-dict mapping
        :return: ngram in the timestamp-to-namedtuple mapping
        
petastorm/ngram.py