DataFrame.assign()
pandas.DataFrame.assign
-
DataFrame.assign(**kwargs)
[source] -
Assign new columns to a DataFrame, returning a new object (a copy) with all the original columns in addition to the new ones.
New in version 0.16.0.
Parameters: kwargs : keyword, value pairs
keywords are the column names. If the values are callable, they are computed on the DataFrame and assigned to the