I want to convert a Pandas DataFrame into a list of objects.
This is my class:
class Reading:
def __init__(self):
self.HourOfDay: int = 0
self.Percentage: float = 0
I read up on .to_dict, so I tried
df.to_dict(into=Reading)
but it returned
TypeError: unsupported type
I don't want a list of tuples, or a list of dicts, but a list of Readings. Every question I've found so far seems to be about these two scenarios. But I want my own typed objects.
Thanks