Create objects from dataframe

  dataframe, object, pandas, python

How to create objects from pandas dataframe?
I have a class named people and i want to create objects based on collumn dataframe names (the column has people name too) how can be seen below:

What I have:

Class People:
   def__init__(self):
       pass

Pandas Dataframe

People  Age  Profession
Jorge   29   Student
Nathan  36   Enginer

What I want (automatycally from dataframe)

Jorge = People()
Nathan = People()

Source: Python Questions

LEAVE A COMMENT