Skip to main content
clear instruction
Source Link
Hafizur Rahman
  • 2.4k
  • 1
  • 24
  • 33

The following worked for me:

from pandas import read_excel
# find your sheetmy_sheet name= at'Sheet1' the# bottomchange leftit ofto your excel file andsheet assignname, 
#you itcan tofind my_sheetyour 
my_sheetsheet =name 'Sheet1'at #the changebottom itleft toof your sheetexcel namefile
file_name = 'products_and_categories.xlsx' # change it to the name of your excel file
df = read_excel(file_name, sheet_name = my_sheet)
print(df.head()) # shows headers with top 5 rows
from pandas import read_excel
# find your sheet name at the bottom left of your excel file and assign 
# it to my_sheet 
my_sheet = 'Sheet1' # change it to your sheet name
file_name = 'products_and_categories.xlsx' # change it to the name of your excel file
df = read_excel(file_name, sheet_name = my_sheet)
print(df.head()) # shows headers with top 5 rows

The following worked for me:

from pandas import read_excel
my_sheet = 'Sheet1' # change it to your sheet name, you can find your sheet name at the bottom left of your excel file
file_name = 'products_and_categories.xlsx' # change it to the name of your excel file
df = read_excel(file_name, sheet_name = my_sheet)
print(df.head()) # shows headers with top 5 rows
added 48 characters in body
Source Link
Hafizur Rahman
  • 2.4k
  • 1
  • 24
  • 33
from pandas import read_excel
# find your sheet name at the bottom left of your excel file and assign 
# it to my_sheet 
my_sheet = 'Sheet1' # change it to your sheet name
file_name = 'products_and_categories.xlsx' # change it to the name of your excel file
df = read_excel(file_name, sheet_name = my_sheet)
print(df.head()) # shows headers with top 5 rows
from pandas import read_excel
# find your sheet name at the bottom left of your excel file and assign 
# it to my_sheet 
my_sheet = 'Sheet1'
file_name = 'products_and_categories.xlsx' # name of your excel file
df = read_excel(file_name, sheet_name = my_sheet)
print(df.head()) # shows headers with top 5 rows
from pandas import read_excel
# find your sheet name at the bottom left of your excel file and assign 
# it to my_sheet 
my_sheet = 'Sheet1' # change it to your sheet name
file_name = 'products_and_categories.xlsx' # change it to the name of your excel file
df = read_excel(file_name, sheet_name = my_sheet)
print(df.head()) # shows headers with top 5 rows
deleted 1 character in body
Source Link
Hafizur Rahman
  • 2.4k
  • 1
  • 24
  • 33
from pandas import read_excel
# find your sheet name at the bottom left of your excel file and assign 
# it to sheet_namemy_sheet 
my_sheet = 'Sheet1'
file_name = 'products_and_categories.xlsx' # name of your excel file
df = read_excel(file_name, sheet_name = my_sheet)
print(df.head()) # shows headers with top 5 rows
from pandas import read_excel
# find your sheet name at the bottom left of your excel file and assign 
# it to sheet_name
my_sheet = 'Sheet1'
file_name = 'products_and_categories.xlsx' # name of your excel file
df = read_excel(file_name, sheet_name = my_sheet)
print(df.head()) # shows headers with top 5 rows
from pandas import read_excel
# find your sheet name at the bottom left of your excel file and assign 
# it to my_sheet 
my_sheet = 'Sheet1'
file_name = 'products_and_categories.xlsx' # name of your excel file
df = read_excel(file_name, sheet_name = my_sheet)
print(df.head()) # shows headers with top 5 rows
added 44 characters in body
Source Link
Hafizur Rahman
  • 2.4k
  • 1
  • 24
  • 33
Loading
added 21 characters in body
Source Link
Hafizur Rahman
  • 2.4k
  • 1
  • 24
  • 33
Loading
simplied pandas read_excel importing
Source Link
Hafizur Rahman
  • 2.4k
  • 1
  • 24
  • 33
Loading
Source Link
Hafizur Rahman
  • 2.4k
  • 1
  • 24
  • 33
Loading