As of pandas 2.0, append (previously deprecated) was removed.

You need to use concat instead (for most applications):

df = pd.concat([df, pd.DataFrame([new_row])], ignore_index=True)

As noted by @cottontail, it's also possible to use loc, although this only works if the new index is not already present in the DataFrame (typically, this will be the case if the index is a RangeIndex:

df.loc[len(df)] = new_row # only use with a RangeIndex!

Why was it removed?

We frequently see new users of pandas try to code like they would do it in pure Python. They use iterrows to access items in a loop (see here why you shouldn't), or append in a way that is similar to python list.append.

However, as noted in pandas' issue #35407, pandas's append and list.append are really not the same thing. list.append is in place, while pandas's append creates a new DataFrame:

I think that we should deprecate Series.append and DataFrame.append. They're making an analogy to list.append, but it's a poor analogy since the behavior isn't (and can't be) in place. The data for the index and values needs to be copied to create the result.

These are also apparently popular methods. DataFrame.append is around the 10th most visited page in our API docs.

Unless I'm mistaken, users are always better off building up a list of values and passing them to the constructor, or building up a list of NDFrames followed by a single concat.

As a consequence, while list.append is amortized O(1) at each step of the loop, pandas' append is O(n), making it inefficient when repeated insertion is performed.

What if I need to repeat the process?

Using append or concat repeatedly is not a good idea (this has a quadratic behavior as it creates a new DataFrame for each step).

In such case, the new items should be collected in a list, and at the end of the loop converted to DataFrame and eventually concatenated to the original DataFrame.

lst = []

for new_row in items_generation_logic:
    lst.append(new_row)

# create extension
df_extended = pd.DataFrame(lst, columns=['A', 'B', 'C'])
# or columns=df.columns if identical columns

# concatenate to original
out = pd.concat([df, df_extended])
Answer from mozway on Stack Overflow
Top answer
1 of 4
480

As of pandas 2.0, append (previously deprecated) was removed.

You need to use concat instead (for most applications):

df = pd.concat([df, pd.DataFrame([new_row])], ignore_index=True)

As noted by @cottontail, it's also possible to use loc, although this only works if the new index is not already present in the DataFrame (typically, this will be the case if the index is a RangeIndex:

df.loc[len(df)] = new_row # only use with a RangeIndex!

Why was it removed?

We frequently see new users of pandas try to code like they would do it in pure Python. They use iterrows to access items in a loop (see here why you shouldn't), or append in a way that is similar to python list.append.

However, as noted in pandas' issue #35407, pandas's append and list.append are really not the same thing. list.append is in place, while pandas's append creates a new DataFrame:

I think that we should deprecate Series.append and DataFrame.append. They're making an analogy to list.append, but it's a poor analogy since the behavior isn't (and can't be) in place. The data for the index and values needs to be copied to create the result.

These are also apparently popular methods. DataFrame.append is around the 10th most visited page in our API docs.

Unless I'm mistaken, users are always better off building up a list of values and passing them to the constructor, or building up a list of NDFrames followed by a single concat.

As a consequence, while list.append is amortized O(1) at each step of the loop, pandas' append is O(n), making it inefficient when repeated insertion is performed.

What if I need to repeat the process?

Using append or concat repeatedly is not a good idea (this has a quadratic behavior as it creates a new DataFrame for each step).

In such case, the new items should be collected in a list, and at the end of the loop converted to DataFrame and eventually concatenated to the original DataFrame.

lst = []

for new_row in items_generation_logic:
    lst.append(new_row)

# create extension
df_extended = pd.DataFrame(lst, columns=['A', 'B', 'C'])
# or columns=df.columns if identical columns

# concatenate to original
out = pd.concat([df, df_extended])
2 of 4
81

Disclaimer: this answer seems to attract popularity, but the proposed approach should not be used. append was not changed to _append, _append is a private internal method and append was removed from pandas API. The claim "The append method in pandas look similar to list.append in Python. That's why append method in pandas is now modified to _append." is utterly incorrect. The leading _ only means one thing: the method is private and is not intended to be used outside of pandas' internal code.


In the new version of Pandas, the append method is changed to _append. You can simply use _append instead of append, i.e., df._append(df2).

df = df1._append(df2,ignore_index=True)

Why is it changed?

The append method in pandas looks similar to list.append in Python. That's why the append method in pandas is now modified to _append.

🌐
Streamlit
discuss.streamlit.io › using streamlit
AttributeError: 'DataFrame' object has no attribute 'append' when using st.session_state" - Using Streamlit - Streamlit
September 5, 2023 - Summary Hello everyone, I’m facing a peculiar issue while using st.session_state with Pandas DataFrames. I’ve set up a session state variable as a DataFrame to hold some course information. I’m trying to append a new ro…
Discussions

'DataFrame' object has no attribute 'append'
ERROR:AttributeError: 'DataFrame' object has no attribute 'append' I am reporting a problem with GSEApy==1.1.2, Pandas==2.1.4 , and Python==3.11.6 system as follows: I use the code ... More on github.com
🌐 github.com
3
March 1, 2024
The discussion is about an error that occurs when running a Python Script Legacy node in KNIME, where the error states that a "DataFrame" object has no attribute "append".
However, I am encountering an error that states: “Execution Error: ‘DataFrame’ object has no attribute append,” even though I have not used the “append” function in my code. When I try to execute the entire code in the Python Script Legacy node, it runs successfully. More on forum.knime.com
🌐 forum.knime.com
1
0
June 21, 2024
Opinions on adding to DataFrames
That article should probably be updated. append has been deprecated for years and was removed. pd.DataFrame().append # AttributeError: 'DataFrame' object has no attribute 'append' The code example uses ._append which is still there, but that whole section should be removed. https://github.com/pandas-dev/pandas/issues/35407 More on reddit.com
🌐 r/learnpython
4
1
June 17, 2024
AttributeError: 'DataFrame' object has no attribute 'append'
when running the frameworks on my benchmark suite (of two tasks) I am running into several issues...is there are current known issue executing the frameworks? running the single line "runbench... More on github.com
🌐 github.com
3
1
🌐
Built In
builtin.com › articles › attributeerror-dataframe-object-has-no-attribute-append
AttributeError: ‘DataFrame’ Object Has No Attribute ‘Append’ Solved | Built In
July 8, 2024 - AttributeError: ‘DataFrame’ object has no attribute ‘append’ can be solved by replacing append() with the concat() method to merge two or more Pandas DataFrames together.
🌐
GitHub
github.com › zqfang › GSEApy › issues › 258
'DataFrame' object has no attribute 'append' · Issue #258 · zqfang/GSEApy
March 1, 2024 - result = adata_mi.uns['dea_lei_mi'] groups = result['names'].dtype.names for group in groups : degs = pd.DataFrame({ key: result[key][group] for key in ['names','scores', 'pvals','pvals_adj','logfoldchanges']}) degs_sig = degs[degs.pvals_adj < 0.05] degs_up = degs_sig[degs_sig.logfoldchanges > 0] degs_dw = degs_sig[degs_sig.logfoldchanges < 0] enr_dw = gp.enrichr(degs_dw["names"].tolist(), gene_sets=['GO_Biological_Process_2023'], outdir=None) ... `AttributeError Traceback (most recent call last) /tmp/ipykernel_941722/3709642233.py in ?() 6 degs = pd.DataFrame({ key: result[key][group] for key
Author   rubickkkkk
🌐
Medium
himanshushekhar1.medium.com › dataframe-has-no-attribute-append-error-effective-solutions-for-pandas-users-d985e6b08eee
‘DataFrame’ Has No Attribute ‘append’ Error: Effective Solutions for Pandas Users | by Himanshu Shrivastava | Medium
July 25, 2024 - And ever since Pandas version 1.4.0, ... object has no attribute ‘append’. This error occurs when we try to use the append function on a pandas DataFrame in a manner that is not supported....
🌐
Medium
medium.com › pipeline-a-data-engineering-resource › pandas-2-0-release-deprecated-your-favorite-method-what-now-819fd2d798a3
Error DataFrame object has no attribute 'append' | PipelineToDE
February 24, 2024 - Pandas' .append() deprecation error solved, along with proper context for why the change was made with Pandas 2.0 and how to adjust your data pipelines.
Find elsewhere
🌐
GitHub
github.com › openml › automlbenchmark › discussions › 603
AttributeError: 'DataFrame' object has no attribute 'append' · openml/automlbenchmark · Discussion #603
The DataFrame.append method got removed in Pandas 2.0, so it is likely you (accidentally) installed a newer pandas into the automl benchmark virtual environment (possibly while working on your notebooks).
Author   openml
🌐
Python.org
discuss.python.org › python help
Need help on using .append and .concat - Python Help - Discussions on Python.org
August 7, 2023 - Here is my coding: train_dataset = pd.read_csv('train.csv') test_dataset = pd.read_csv('test.csv') train_dataset.head() test['Target'] = np.nan data = train_dataset.append(test_dataset, ignore_index = True) · The AttributeError is occurring because the DataFrame object in pandas does not have ...
🌐
TIBCO
support.tibco.com › external › article › 70584 › how-to-resolve-the-attributeerror-datafr.html
How to resolve the "AttributeError: 'DataFrame' object has no attribute 'append' error" while using Sentiment Analysis in Statistica
August 16, 2023 - We can achieve Sentiment Intensity Analysis in Statistica using R and Python packages. We have attached an example workspace in this article. If you encounter the "AttributeError: 'DataFrame' object has no attribute 'append' error" while running the workspace, please follow the steps described ...
🌐
Software House
softwarehouse.au › home › blog › how to resolve attributeerror dataframe object has no attribute append in pandas
Fix: Pandas DataFrame 'append' Attribute Error
3 weeks ago - To address these issues and boost performance, the Pandas development team deprecated append() in favor of more scalable solutions. The error, displayed as AttributeError: 'DataFrame' object has no attribute 'append' or, more helpfully, AttributeError: 'DataFrame' object has no attribute 'append'.
🌐
TestMu AI Community
community.testmuai.com › ask a question
How do I fix the 'DataFrame' object has no attribute 'append' error when adding a new row? - TestMu AI Community
May 23, 2025 - I’m trying to add a dictionary as a new row to a DataFrame, but I keep getting the error: AttributeError: ‘DataFrame’ object has no attribute ‘append’ I thought append() was valid for DataFrames, but it seems this no longer works. Here’s the line I’m using: df = pd.DataFrame(df).append(new_row, ignore_index=True) This used to work earlier, so why am I seeing ‘DataFrame’ object has no attribute ‘append’ now?
🌐
Brainly
brainly.com › computers and technology › high school › attributeerror: 'dataframe' object has no attribute 'append'. how can this be resolved?
[FREE] AttributeError: 'DataFrame' object has no attribute 'append'. How can this be resolved? - brainly.com
The error 'AttributeError: 'DataFrame' object has no attribute 'append'' occurs when trying to use 'append' on a pandas DataFrame object. Use 'concat' or '+' to join DataFrames together.
🌐
PsychoPy
discourse.psychopy.org › coding
'DataFrame' object has no attribute 'append' - Coding - PsychoPy
April 24, 2023 - Im am trying to use: trials.saveAsWideText(resfile, delim= ‘;’, fileCollisionMethod=‘rename’, encoding=‘utf-8’) but the results are not saved and I get the error message Attribute Error trials.saveAsWideText(resfile, delim= ‘;’, fileCollisionMethod=‘rename’, encoding=‘utf-8’) in teh line File C:\Program Files\PsychoPy\Lib\site-packages\psychopy\data\trial.py:694 in saveAsWideText df = df.append(nextEntry, ignore_index=True) I figured that the append method is not valid anymore, am I us...
🌐
Python Forum
python-forum.io › thread-37447.html
Using .append() with list vs dataframe
My program adds rows to a dataframe by using .append() with a dictionary. In order to make this work, I think I had to do df = df.append() rather than just df.append(). Going back and retrying this afternoon, though, I think I've seen it work eithe...
🌐
Google Groups
groups.google.com › g › web2py › c › mTOwfjcWJGo
AttributeError: 'Rows' object has no attribute 'append'
When I comment out row.append(row) and return rows and morerows rows contains 3 records and morerows 5. Why doesn't this work? If you want a unified Rows class instance to be handled by the action view, I think that you need a complete db query as input before calling .select, because, I'm almost sure that adding rows on the fly to a Rows instance is not supported. An alternative would be to use a list object as result instead of Rows to add the Row instances, in that case you will be able to do <list object>.append(row).
🌐
Reddit
reddit.com › r/learnpython › attributeerror: 'nonetype' object has no attribute 'append'
r/learnpython on Reddit: AttributeError: 'NoneType' object has no attribute 'append'
May 10, 2023 -

Hi all.

Why does my code append chicken and beef to the finished_sandwiches list, but I get the error message for the peperoni?

Thanks in advance.

sandwich_orders = ['chicken', 'beef', 'peperoni', 'ham',  'cheese & tomato']
finished_sandwiches = []

for sandwich in sandwich_orders:
    print(f"I made your {sandwich} sandwich")
    finished_sandwiches = finished_sandwiches.append(sandwich)

print("=================")
for sandwich in finished_sandwiches:
    print(finished_sandwiches)

Output:

I made your chicken sandwich
I made your beef sandwich
Traceback (most recent call last):
  File "/home/piehead/Documents/Python/crash course/exercises/7_8.py", line 6, in <module>
    finished_sandwiches = finished_sandwiches.append(sandwich)
AttributeError: 'NoneType' object has no attribute 'append'
🌐
GitHub
github.com › pydata › pandas-datareader › issues › 966
'DataFrame' object has no attribute 'append' · Issue #966 · pydata/pandas-datareader
June 14, 2023 - AttributeError: 'DataFrame' object has no attribute 'append' The main reason is that DataFrame no longer support append operation. It have to be changed with concat method. Reactions are currently unavailable · No one assigned · No labels ...
Author   AntonCoon