I'm new to Python and trying to create a class with multiple attributes. I would like to access the attributes like the following:
measured_dataset.date
measured_dataset.temperature1
measured_dataset.temperature2
The attributes date
, temperature1
, and temperature2
will be variables with lists:
measured_date = [1,2,3]
measured_dataset = dataset('date', measured_date)
I tried to create a class like:
class dataset :
def __init__(self, name, value = []) :
self.name = name
self.parameter = parameter
But somehow I'm only able to create measured_dataset.name
.
How can I create what I want?