How to import CSV and Excel file into Jupyter Notebook:

In [ ]:
import pandas as pd
In [15]:
# Importing CSV File

df1 = pd.read_csv("/home/bahar/Documents/All Data/Pandas/Course1/sample1.csv")

df1
Out[15]:
sample1 sample2 sample3
0 5 4 33
1 8 5 66
2 9 9 77
In [16]:
#Importing Excel File

xls = pd.ExcelFile('/home/bahar/Documents/All Data/Pandas/Course1/sample.xlsx')

#Parsing Sheet1 of excel file 

df2 = xls.parse('Sheet1')

df2
Out[16]:
sample1 sample2 sample3
0 5 4 33
1 8 5 66
2 9 9 77