convert sample.data to dict from namedtuple when flattening out records