1#using the insert function:
2df.insert(location, column_name, list_of_values)
3#example
4df.insert(0, 'new_column', ['a','b','c'])
5#explanation:
6#put "new_column" as first column of the dataframe
7#and puts 'a','b' and 'c' as values
8
9#using array-like access:
10df['new_column_name'] = value
11
12#df stands for dataframe
1# Basic syntax:
2pandas_dataframe['new_column_name'] = ['list', 'of', 'column', 'values']
3
4# Note, the list of column values must have length equal to the number
5# of rows in the pandas dataframe you are adding it to.
6
7# Add column in which all rows will be value:
8pandas_dataframe['new_column_name'] = value
9# Where value can be a string, an int, a float, and etc