pandas add column with constant value code example
Example 1: pandas add column with constant value
# Adding Column
df['Column Name'] = 'Value'
# Pass a list also, but it should match number of rows.
df['Column Name'] = ['should', 'match_rows','otherwise', 'error']
Example 2: python add column with constant value
df['new'] = '1'