generate functionThu, 30 Mar 2023

add a new column called "TV" to a dataframe called "df"

def new_column(df, new_column_name, new_column_value): df[new_column_name] = new_column_value return df new_column(df, "TV", df["TV"])

Questions about programming?Chat with your personal AI assistant