You can create an empty DataFrame with either column names or an Index:

In [4]: import pandas as pd
In [5]: df = pd.DataFrame(columns=['A','B','C','D','E','F','G'])
In [6]: df
Out[6]:
Empty DataFrame
Columns: [A, B, C, D, E, F, G]
Index: []

Or

In [7]: df = pd.DataFrame(index=range(1,10))
In [8]: df
Out[8]:
Empty DataFrame
Columns: []
Index: [1, 2, 3, 4, 5, 6, 7, 8, 9]

Edit: Even after your amendment with the .to_html, I can't reproduce. This:

df = pd.DataFrame(columns=['A','B','C','D','E','F','G'])
df.to_html('test.html')

Produces:

<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>A</th>
      <th>B</th>
      <th>C</th>
      <th>D</th>
      <th>E</th>
      <th>F</th>
      <th>G</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>
Answer from Marcus V. on Stack Overflow
🌐
Saturn Cloud
saturncloud.io › blog › how-to-create-an-empty-dataframe-with-only-column-names-in-pandas
How to Create an Empty DataFrame with Only Column Names in Pandas | Saturn Cloud Blog
June 19, 2023 - This can be useful when you want to define the structure of your DataFrame before filling it with data. To create an empty DataFrame with only column names, you can use the pandas.DataFrame() constructor and specify the column names as a list.
Discussions

python - How to (re)name an empty column header in a pandas dataframe without exporting to csv - Stack Overflow
I have a pandas dataframe df1 with an index column and an unnamed series of values. I want to assign a name to the unnamed series. The only way to do this that I know so far is to export to df1.csv More on stackoverflow.com
🌐 stackoverflow.com
Adding a header and a blank row before column names (Pandas)
# Create your original dataframe df_data = pd.DataFrame([['Year', 'Week', 'Value'], ['2022', '01', '300']]) # Create your headers df = pd.DataFrame(["Silly Header", '']) # Combine both pd.concat([df, df_data]) Post your code and data examples if it isn't working. More on reddit.com
🌐 r/learnpython
5
3
March 28, 2024
What is your opinion on Pandas multi indices and how do you use them?
Pandas had a lot of cool ideas in it, but indexes just make things too complicated compared to just having everything as columns. After every operation you've got to check whether the data you wanted to work with has moved into the index, and pull it out again if it has. My code just ends up full of random reset_index() or to_frame() calls. I'm starting to use Polars for actual projects, and just having all data as columns makes everything so much easier to work with and think about. More on reddit.com
🌐 r/Python
8
7
July 6, 2023
Pandas: Losing a column in read_csv when the first row has no value in that column
Does the csv have headers? What read_csv options are you using? Perhaps you can show an example of this happening: import io import pandas as pd csv = io.BytesIO(b""" one,two,three ,2,3 """) File with headers and first value missing, everything stays in the correct position: >>> pd.read_csv(csv) one two three 0 NaN 2 3 More on reddit.com
🌐 r/learnpython
4
0
March 27, 2023
🌐
Statology
statology.org › home › pandas: how to create empty dataframe with column names
Pandas: How to Create Empty DataFrame with Column Names
October 25, 2021 - The following code shows how to create a pandas DataFrame with specific column names and no rows: import pandas as pd #create DataFrame df = pd.DataFrame(columns=['A', 'B', 'C', 'D', 'E']) #view DataFrame df A B C D E · We can use shape to get the size of the DataFrame: ... This tells us that the DataFrame has 0 rows and 5 columns.
🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › pandas empty dataframe with column names & types
Pandas Empty DataFrame with Column Names & Types - Spark By {Examples}
October 14, 2024 - Sometimes you would be required to create an empty DataFrame with column names and specific types in pandas, In this article, I will explain how to do
🌐
Arab Psychology
scales.arabpsychology.com › home › how to create an empty pandas dataframe with column names: a step-by-step guide
How To Create An Empty Pandas DataFrame With Column Names: A Step-by-Step Guide
December 3, 2025 - You can use the following basic syntax to create an empty pandas DataFrame with specific column names: df = pd.DataFrame(columns=['Col1', 'Col2', 'Col3']) This syntax immediately returns an object named df that is structurally sound but devoid of data points.
🌐
Python Examples
pythonexamples.org › python-pandas-create-empty-dataframe-with-column-names
How to create an empty DataFrame with specific column names?
In this example, we create an empty DataFrame with specific column names using DataFrame(). import pandas as pd df = pd.DataFrame(columns=['name', 'age', 'country']) print(df)
🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › pandas create empty dataframe
Pandas Create Empty DataFrame - Spark By {Examples}
January 7, 2025 - I will explain how to create an empty DataFrame in pandas with or without column names (column names) and Indices. Below I have explained one of the many
Find elsewhere
🌐
Medium
medium.com › @amit25173 › how-to-create-empty-dataframe-in-pandas-a-practical-guide-for-beginners-0480201c3922
How to Create Empty DataFrame in Pandas: A Practical Guide for Beginners | by Amit Yadav | Medium
April 12, 2025 - This code snippet gives you an empty DataFrame with three specified columns: Name, Age, and City. You can easily add data later without worrying about structure. Method 3: Creating an Empty DataFrame with Specific Data Types · Sometimes, you may want to create an empty DataFrame with specific data types for each column. This can be handy for ensuring data integrity: import pandas as pd # Creating an empty DataFrame with specific data types empty_df = pd.DataFrame({ 'Name': pd.Series(dtype='str'), 'Age': pd.Series(dtype='int'), 'Salary': pd.Series(dtype='float') }) print(empty_df)
🌐
Syntx Scenarios
syntaxscenarios.com › home › python › how to create an empty dataframe in pandas?
How to Create an Empty DataFrame in Pandas?
February 22, 2025 - Here, we pass a list of column names ("Name", "Age", "City") to the columns parameter. The result is an empty DataFrame with three columns but no rows. The DataFrame is then displayed as the output. import pandas as pd # Create an empty DataFrame ...
🌐
Kanaries
docs.kanaries.net › topics › Pandas › create-empty-dataframe
How to Create Empty DataFrame in Pandas – Kanaries
November 14, 2025 - In Pandas 2.x, it's best practice to define column types upfront: import pandas as pd df = pd.DataFrame({ "ProductID": pd.Series(dtype="int"), "ProductName": pd.Series(dtype="string"), "Description": pd.Series(dtype="string"), "Price": pd.Series(dtype="float"), }) df ... ✔ You're loading data from APIs ✔ You want predictable types ✔ You're building ETL pipelines ✔ You want to avoid dtype warnings later ... df = pd.DataFrame() print(df.empty) # True non_empty = pd.DataFrame({"A": [1]}) print(non_empty.empty) # False
🌐
Board Infinity
boardinfinity.com › blog › how-to-create-an-empty-dataframe-in-python-using-pandas
How to create an Empty Dataframe in Python using Pandas?
July 19, 2025 - Creating placeholders: For example, if you want to build a DataFrame with definite column labels but the data are not yet accumulated. Empty DataFrame as output: If creating new multifaceted pipelines or procedures that may be required to return an empty DataFrame in some circumstances. The structure of an empty DataFrame looks like this: ... The initial and what is maybe the most basic way of creating a DataFrame in Pandas with no data is by applying the pd.DataFrame() function is empty-handed.
🌐
Easy Tweaks
easytweaks.com › home › python - data analysis › how to make an empty pandas dataframes with python and append data to it?
Create new dataframes in Pandas with column names | EasyTweaks.com
July 2, 2021 - If that’s the case you might need to install Pandas in your system first. Now let’s define some data that we’ll use through the tutorial: df_cols = ['city', 'month' , 'year', 'min_temp', 'max_temp'] Let’s first go ahead and add a DataFrame from scratch with the predefined columns we introduced in the preparatory step: #with column names new_df = pd.DataFrame(columns=df_cols) We can now easily validate that the DF is indeed empty using the relevant attribute:
🌐
iO Flood
ioflood.com › blog › create-empty-dataframe
How To Create an Empty Dataframe: Python Pandas Guide
June 6, 2024 - In the above code, we first import the pandas and numpy libraries. We then create an empty DataFrame using the numpy function ’empty’. This function returns a new array of given shape and type, without initializing entries. We define the structure of the array with a dtype parameter, which is a list of tuples. Each tuple represents a column and its type. The resulting DataFrame has the columns ‘Name’, ‘Age’, and ‘Gender’, but no data.
🌐
Favtutor
favtutor.com › articles › add-empty-column-dataframe-pandas
Add Empty Column to Pandas DataFrame (with code)
December 29, 2023 - import pandas as pd # Create a sample DataFrame df = pd.DataFrame({'Column1': [1, 2, 3], 'Column2': ['A', 'B', 'C']}) # Display the original DataFrame print('Original DataFrame:\n', df) # Add an empty column named 'Column3' df['Column3'] = '' # Display the new DataFrame print('New DataFrame:\n', df)
🌐
Mouse Vs Python
blog.pythonlibrary.org › home › adding data to empty dataframes in pandas
Adding Data to Empty DataFrames in pandas - Mouse Vs Python
August 9, 2022 - Now let’s learn how to create an empty DataFrame that includes columns, but no data! This next example will show you how to create a pandas DataFrame that includes columns, but no indices or column data. ... >>> import pandas as pd >>> df = pd.DataFrame(columns=["Name", "Job"]) >>> df Empty DataFrame Columns: [Name, Job] Index: [] # Add some data using append() >>> df = df.append({"Name": "Mike", "Job": "Blogger"}, ignore_index=True) >>> df Name Job 0 Mike Blogger >>> df = df.append({"Name": "Luciano", "Job": "Author"}, ignore_index=True) >>> df Name Job 0 Mike Blogger 1 Luciano Author
🌐
GeeksforGeeks
geeksforgeeks.org › pandas › how-to-create-an-empty-dataframe-and-append-rows-columns-to-it-in-pandas
Pandas Append Rows & Columns to Empty DataFrame - GeeksforGeeks
Columns are added directly by assigning lists to column names. Rows are appended using the concat() method, which is efficient and recommended for appending rows. There are multiple ways to append rows and columns to an empty Pandas DataFrame, here we will implement each of them.
Published   July 15, 2025
🌐
Sling Academy
slingacademy.com › article › pandas-how-to-create-an-empty-dataframe-with-column-names
Pandas: How to create an empty DataFrame with column names - Sling Academy
Introduction Creating an empty DataFrame with column names in Pandas is an important skill, particularly for scenarios where you need to initialize a dataset without any data initially. This approach is useful in data processing...