how to initialize multiple columns to existing pandas DataFrame
<p>how can I initialize multiple columns in a single instance in an existing pandas DataFrame object? I can initialize single column at an instance, this way:</p>

<pre><code>df = pd.DataFrame({'a':[1,2,3],'b':[4,5,6]}, dtype='int')
df['c'] = 0
</code></pre>

<p>but i cannot do something like:</p>

<pre><code>df[['c','d']] = 0 or
df[['c']['d']] = 0
</code></pre>

<p>is there a way i can achieve this?</p>

<p><strong><em><code>pd.concat</code></em></strong></p>

<pre><code>pd.concat([df, pd.DataFrame(0, df.index, list('cd'))], axis=1)
</code></pre>

<p><a href="http://i.stack.imgur.com/4L9rZ.png" rel="nofollow"><img src="http://i.stack.imgur.com/4L9rZ.png" alt="enter image description here"></a></p>

<hr>

<p><strong><em><code>join</code></em></strong></p>

<pre><code>df.join(pd.DataFrame(0, df.index, list('cd')))
</code></pre>

<p><a href="http://i.stack.imgur.com/4L9rZ.png" rel="nofollow"><img src="http://i.stack.imgur.com/4L9rZ.png" alt="enter image description here"></a></p>

python pandas dataframe