I have the following CSV file:
id;area;zz;nc
1;35.66;2490.8;1
2;65.35;2414.93;1
3;79.05;2269.33;1
4;24.5;2807.68;1
5;19.31;2528.59;1
6;25.51;2596.44;1
where each rows represents a so called Cell object with its id, area, zz, cc.
Consequentially, I have created the following class:
class cells():
#
# Initializer / Instance Attributes
def __init__(self, idm, area,zz,nc):
self.idm = idm
self.area = area
The idea is to create a number of object as the number of cells and to assign to them the attributes according to the data in the file.
The first idea that I have is to read the csv file as a DataFrame and after a list of objects to be populated in a cycle.
As far as I know, python is very inefficient with cycle and I would like to know if there is another way (smart one) to do that.
Thanks, Diego