Convert CSV to Excel using Pandas in Python Last Updated : 22 Feb, 2022 Comments Improve Suggest changes Like Article Like Report Pandas can read, filter, and re-arrange small and large datasets and output them in a range of formats including Excel. In this article, we will be dealing with the conversion of .csv file into excel (.xlsx). Pandas provide the ExcelWriter class for writing data frame objects to excel sheets. Syntax: final = pd.ExcelWriter('GFG.xlsx') Example:Sample CSV File: Python3 import pandas as pd # Reading the csv file df_new = pd.read_csv('Names.csv') # saving xlsx file GFG = pd.ExcelWriter('Names.xlsx') df_new.to_excel(GFG, index=False) GFG.save() Output: Method 2: The read_* functions are used to read data to pandas, the to_* methods are used to store data. The to_excel() method stores the data as an excel file. In the example here, the sheet_name is named passengers instead of the default Sheet1. By setting index=False the row index labels are not saved in the spreadsheet. Python3 import pandas as pd # The read_csv is reading the csv file into Dataframe df = pd.read_csv("./weather_data.csv") # then to_excel method converting the .csv file to .xlsx file. df.to_excel("weather.xlsx", sheet_name="Testing", index=False) # This will make a new "weather.xlsx" file in your working directory. # This code is contributed by Vidit Varshney Comment More infoAdvertise with us Next Article Convert CSV to Excel using Pandas in Python rutujakawade24 Follow Improve Article Tags : Python Python-pandas Practice Tags : python Similar Reads Convert Excel to PDF Using Python Python is a high-level, general-purpose, and very popular programming language. Python programming language (latest Python 3) is being used in web development, Machine Learning applications, along with all cutting-edge technology in Software Industry.In this article, we will learn how to convert an 1 min read Convert Text File to CSV using Python Pandas Converting Text File to CSV using Python Pandas refers to the process of transforming a plain text file (often with data separated by spaces, tabs, or other delimiters) into a structured CSV (Comma Separated Values) file using the Python Pandas library.In this article we will walk you through multip 2 min read Convert Excel to CSV in Python In this article, we will be dealing with the conversion of Excel (.xlsx) file into .csv.  There are two formats mostly used in Excel : (*.xlsx) : Excel Microsoft Office Open XML Format Spreadsheet file.(*.xls) : Excel Spreadsheet (Excel 97-2003 workbook). Let's Consider a dataset of a shopping store 3 min read Convert PDF to CSV using Python Python is a high-level, general-purpose, and very popular programming language. Python programming language (the latest Python 3) is being used in web development, Machine Learning applications, along with all cutting-edge technology in Software Industry. Python Programming Language is very well sui 2 min read How to convert CSV File to PDF File using Python? In this article, we will learn how to do Conversion of CSV to PDF file format. This simple task can be easily done using two Steps : Firstly, We convert our CSV file to HTML using the PandasIn the Second Step, we use PDFkit Python API to convert our HTML file to the PDF file format. Approach: 1. Con 3 min read How to convert PDF file to Excel file using Python? In this article, we will see how to convert a PDF to Excel or CSV File Using Python. It can be done with various methods, here are we are going to use some methods. Method 1: Using pdftables_api Here will use the pdftables_api Module for converting the PDF file into any other format. It's a simple 2 min read How to Convert JSON to Excel in Python JSON (JavaScript Object Notation) is a widely used data format that is both easy to read and write for humans and simple for machines to parse and generate. However, there may be times when we need to convert this JSON data into an Excel spreadsheet for analysis or reporting. In this article, we'll 3 min read Convert JSON to CSV in Python We can convert JSON to CSV in Python using the built-in json and csv modules.What is JSON and CSV?JSON is a lightweight, text-based data format commonly used to exchange data between web servers and clients. It stores data in key-value pairs and is typically used for data transmission in web applica 2 min read Convert XML to CSV in Python XML (Extensible Markup Language) is widely used to store and transport structured data. However, for tasks like data analysis or spreadsheet editing, CSV (Comma-Separated Values) is far more user-friendly and easier to work with.To make XML data easier to process, we often convert it to a CSV file. 2 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 Like