My data is in .csv format and each row of data represents each agent while each column represents a certain attribute.
My question is how to assign agents and their attributes from a csv file in Mesa?
Could anyone help me with how to import them in Mesa please?
Thanks.
To import a .csv and turn them into attributes you want to know how you are reading in the file and then pass that into the agent class as you are creating it.
For example:
you have 'people.csv':
you read in as a list of lists:
you pass in a row into your agent instantiation, this would typically occur in the creation of your agent schedule in the model module:
you assign the row variables to agent attributes: