Create Empty Dataframe with Only Column Names in Pandas?

Spread the love

Problem –

You want to create an empty pandas dataframe with only column names in it.

Solution –

import pandas as pd

df = pd.DataFrame(columns=['A','B','C','D','E'])

Rating: 1 out of 5.

Leave a Reply