Convert astropy table to list of dictionaries
I ended up iterating, slicing and copying as list which worked fine on the relatively small dataset.
I have an astropy.table.table object holding stars data. One row per star with columns holding data such as Star Name, Max Magnitude, etc.
I understand an astropy table's internal representation is a dict for each column, with the rows being returned on the fly as slices across the dict objects.
I need to convert the astropy table to a Python list of dict objects, with one dict per star. Essentially this is both a transposition of the table and a conversion.
I can obviously iterate through the table, by column within row, to build the dicts and add them to the list, but I was hoping there was a more efficient way?'