Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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']
 
PREVIOUS NEXT
Tagged: #pandas #add #column #constant
ADD COMMENT
Topic
Name
4+7 =