Add multiple empty columns to pandas DataFrame

This may be a stupid question, but how do I add multiple empty columns to a DataFrame from a list?

I can do:

    df["B"] = None
    df["C"] = None
    df["D"] = None

But I can't do:

    df[["B", "C", "D"]] = None

    KeyError: "['B' 'C' 'D'] not in index"

I'd concat using a DataFrame:

    In [23]:
    df = pd.DataFrame(columns=['A'])
    df

    Out[23]:
    Empty DataFrame
    Columns: [A]
    Index: []

    In [24]:    
    pd.concat([df,pd.DataFrame(columns=list('BCD'))])

    Out[24]:
    Empty DataFrame
    Columns: [A, B, C, D]
    Index: []

So by passing a list containing your original df, and a new one with the columns you wish to add, this will return a new df with the additional columns.

Caveat: See the discussion of performance in the other answers and/or the comment discussions. reindex may be preferable where performance is critical.

From: stackoverflow.com/q/30926670