Docy

pandas Read csv and Excel File

Estimated reading: 1 minute 849 views

Read CSV Files

A simple way to store big data sets is to use CSV files (comma separated files).

CSV files contains plain text and is a well know format that can be read by everyone including Pandas.

In our examples we will be using a CSV file called ‘data.csv’.

Example

Load the CSV into a DataFrame:

				
					import pandas as pd
df = pd.read_csv('data.csv')

				
			

Read Excel Files

A simple way to store big data sets is to use Excel files.

Excel files contains row and column Data.

In our examples we will be using a CSV file called ‘data.xlsx’.

Example

Load the xlsx into a DataFrame:

				
					newData = pds.read_excel(file)
print(newData)
				
			

Leave a Comment

Share this Doc
CONTENTS