bigframes.pandas.DataFrame.assign#

DataFrame.assign(**kwargs)DataFrame[source]#

Assign new columns to a DataFrame.

Returns a new object with all original columns in addition to new ones.Existing columns that are re-assigned will be overwritten.

Note

Assigning multiple columns within the sameassign is possible.Later items in ‘**kwargs’ may refer to newly created or modifiedcolumns in ‘df’; items are computed and assigned into ‘df’ inorder.

Parameters:

kwargs – A dictionary of{str:values}. The column names arekeywords. If the values (e.g. a Series, scalar, or array), theyare simply assigned to the column.

Returns:

A new DataFrame with the new columnsin addition to all the existing columns.

Return type:

bigframes.pandas.DataFrame

On this page

This Page