How to append a list as a row to a Pandas DataFrame in Python? Last Updated : 21 Jun, 2025 Comments Improve Suggest changes Like Article Like Report In this article, We are going to see how to append a list as a row to a pandas dataframe in Python. It can be done in three ways:Using loc[]Using iloc[]Using append()Prerequisite: Pandas DataFrame1. Using loc[]The loc[] method is used for label-based indexing. When you append a list as a row, the loc[] method allows us to specify the index to which we want to append the new data.Step 1: Create a simple dataframe using the list. Python import pandas as pd person = [ ['Satyam', 21, 'Patna' , 'India' ], ['Anurag', 23, 'Delhi' , 'India' ], ['Shubham', 27, 'Coimbatore' , 'India' ]] df = pd.DataFrame(Person, columns = ['Name' , 'Age', 'City' , 'Country']) display(df) Output:Step 2: Using loc to append the new list to a data frame. Python new_row = ["Saurabh", 23, "Delhi", "India"] df.loc[len(df)] = new_row display(df) Output:Explanation: df.loc[len(df)] = new_row appends the new row to the DataFrame, len(df) ensures that the new row is added to the next available index.2. Using iloc[] methodiloc[] method is primarily used for integer-location based indexing. It is typically used for modifying or accessing data based on the row and column index positions, but we can also use it to update an existing row.Example: Python import pandas as pd # Create a sample DataFrame person = [ ['Satyam', 21, 'Patna', 'India'], ['Anurag', 23, 'Delhi', 'India'], ['Shubham', 27, 'Coimbatore', 'India'], ['Saurabh', 23, 'Delhi', 'India'] ] df = pd.DataFrame(person, columns=['Name', 'Age', 'City', 'Country']) new_row = ['Ujjawal', 22, 'Fathua', 'India'] df.iloc[2] = new_row display(df) Output:Explanation: we replace the third row (index 2) with new_row using df.iloc[2] = new_row.Note: It is used for location-based indexing so it works for only the existing index and replaces the row element.3. Using append() methodsPandas dataframe.append() function is used to append rows of other dataframe to the end of the given dataframe, returning a new dataframe object.Example: Python import pandas as pd person = [ ['Satyam', 21, 'Patna', 'India'], ['Anurag', 23, 'Delhi', 'India'], ['Shubham', 27, 'Coimbatore', 'India'] ] df = pd.DataFrame(person, columns=['Name', 'Age', 'City', 'Country']) # New row to append new_row = [["Manjeet", 25, "Delhi", "India"]] # Append the new row using append() df = df.append(pd.DataFrame(new_row, columns=['Name', 'Age', 'City', 'Country']), ignore_index=True) display(df) Output:Explanation: we use df.append() to append the new row, and ignore_index=True ensures the new DataFrame gets a fresh index.Note: append() returns a new DataFrame; it does not modify the original one.Related Articles:loc[]iloc[]append() Comment More infoAdvertise with us Next Article Append list of dictionary and series to a existing Pandas DataFrame in Python K kumar_satyam Follow Improve Article Tags : Technical Scripter Python Technical Scripter 2020 Python-pandas Python pandas-dataFrame Python Pandas-exercise +2 More Practice Tags : python Similar Reads How to Convert a List to a DataFrame Row in Python? In this article, we will discuss how to convert a list to a dataframe row in Python. Method 1: Using T function This is known as the Transpose function, this will convert the list into a row. Here each value is stored in one column. Syntax: pandas.DataFrame(list).T Example: Python3 # import pandas m 3 min read Select any row from a Dataframe in Pandas | Python In this article, we will learn how to get the rows from a dataframe as a list, without using the functions like ilic[]. There are multiple ways to do get the rows as a list from given dataframe. Letâs see them will the help of examples. Python3 # importing pandas as pd import pandas as pd # Create t 1 min read Select any row from a Dataframe in Pandas | Python In this article, we will learn how to get the rows from a dataframe as a list, without using the functions like ilic[]. There are multiple ways to do get the rows as a list from given dataframe. Letâs see them will the help of examples. Python3 # importing pandas as pd import pandas as pd # Create t 1 min read Append list of dictionary and series to a existing Pandas DataFrame in Python In this article, we will discuss how values from a list of dictionaries or Pandas Series can be appended to an already existing pandas dataframe. For this purpose append() function of pandas, the module is sufficient. Syntax: DataFrame.append(other, ignore_index=False, verify_integrity=False, sort=N 2 min read Create a list from rows in Pandas DataFrame | Set 2 In an earlier post, we had discussed some approaches to extract the rows of the dataframe as a Python's list. In this post, we will see some more methods to achieve that goal. Note : For link to the CSV file used in the code, click here. Solution #1: In order to access the data of each row of the Pa 2 min read Create a list from rows in Pandas DataFrame | Set 2 In an earlier post, we had discussed some approaches to extract the rows of the dataframe as a Python's list. In this post, we will see some more methods to achieve that goal. Note : For link to the CSV file used in the code, click here. Solution #1: In order to access the data of each row of the Pa 2 min read Like