Python | Split given list and insert in excel file Last Updated : 28 Feb, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report Given a list containing Names and Addresses consecutively, the task is to split these two elements at a time and insert it into excel. We can use a very popular library for data analysis, Pandas. Using pandas we can easily manipulate the columns and simply insert the filtered elements into excel file using df.to_excel() function. Below is the implementation : Python3 1== # Python code to split the list two element # at a time and insert it into excel. # Importing pandas as pd import pandas as pd # List initialization list1 = ['Assam', 'India', 'Lahore', 'Pakistan', 'New York', 'USA', 'Bejing', 'China'] df = pd.DataFrame() # Creating two columns df['State'] = list1[0::2] df['Country'] = list1[1::2] # Converting to excel df.to_excel('result.xlsx', index = False) Output : Comment More infoAdvertise with us Next Article How to Merge Multiple Excel Files into a Single Files with Python E everythingispossible Follow Improve Article Tags : Python Python-pandas Python-excel Python list-programs Practice Tags : python Similar Reads How to Split a File into a List in Python In this article, we are going to see how to Split a File into a List in Python. When we want each line of the file to be listed at consecutive positions where each line becomes an element in the file, the splitlines() or rstrip() method is used to split a file into a list. Let's see a few examples 5 min read Save user input to a Excel File in Python In this article, we will learn how to store user input in an excel sheet using Python, What is Excel? Excel is a spreadsheet in a computer application that is designed to add, display, analyze, organize, and manipulate data arranged in rows and columns. It is the most popular application for account 4 min read How to import an excel file into Python using Pandas? It is not always possible to get the dataset in CSV format. So, Pandas provides us the functions to convert datasets in other formats to the Data frame. An excel file has a '.xlsx' format. Before we get started,  we need to install a few libraries. pip install pandas pip install xlrd  For importin 2 min read How to Merge Multiple Excel Files into a Single Files with Python We often deal with multiple Excel files that need to be combined into a single consolidated file. Manually merging them or using Excel macros can be slow and prone to errors. To make this process faster and more reliable, we will use Pythonâs pandas module to automate merging multiple Excel files in 3 min read How to split a Python list into evenly sized chunks Iteration in Python is repeating a set of statements until a certain condition is met. This is usually done using a for loop or a while loop. There are several ways to split a Python list into evenly sized-chunks. Here are the 5 main methods: Method 1: Using a Loop with List SlicingUse for loop alon 3 min read Read a CSV into list of lists in Python In this article, we are going to see how to read CSV files into a list of lists in Python. Method 1: Using CSV moduleWe can read the CSV files into different data structures like a list, a list of tuples, or a list of dictionaries.We can use other modules like pandas which are mostly used in ML appl 2 min read Like