Adding new column to data-frame¶
A column can easily be added to data-frame
Using assign() can also add new columns, new columns can be generated using functions, see below
df=df.assign(Ave_hour=df0)
df=df.assign(PI1=lambda x: x['population']*x['median_income'],PI2=df['population']/df['median_income'] )
A new column can be added to data-frame