How do I fill a column with one value in Pandas?

Just select the column and assign like normal:

In [194]:
df['A'] = 'foo'
df

Out[194]:
     A
0  foo
1  foo
2  foo
3  foo

Assigning a scalar value will set all the rows to the same scalar value

Leave a Comment