how can i assign two columns to new dataframe in python code example
Example 1: how to assign a new value in a column in pandas dataframe
df = df.assign(industry='yyy')
Example 2: assign multiple columns pandas
import pandas as pd
df = {'col_1': [0, 1, 2, 3],
'col_2': [4, 5, 6, 7]}
df = pd.DataFrame(df)
df[[ 'column_new_1', 'column_new_2','column_new_3']] = [np.nan, 'dogs',3] #thought this wo