Read Excel file using Python

This article shows how to import data from Excel using Python.

Step 1: install pandas

open Ananconda Command Prompt

Step 2: install pandas

\> pip install pandas

Read excel file

import pandas as pd
dataset1=pd.read_excel("C:/folderpath/filname.xlsx",sheet_name="sheetname")
dataset1.head()
print(dataset1.get("columnname"))

Read data from CSV File

import pandas as pd
dataset1=pd.read_csv("C:/foldername/filename.csv",encoding='ISO-8859-1')
dataset1.head()
print(dataset1.get("columnname"))