Skip to content

Instantly share code, notes, and snippets.

@celeron633
Created January 20, 2024 01:50
Show Gist options
  • Save celeron633/8345a441013db8fd9451b1040ce58724 to your computer and use it in GitHub Desktop.
Save celeron633/8345a441013db8fd9451b1040ce58724 to your computer and use it in GitHub Desktop.
pandas read xlsx with first row
import os
import pandas as pd
try:
sheet = pd.read_excel("test.xlsx", header=None)
except Exception as e:
print('read_excel failed')
exit(-1)
print(sheet.iloc[0,0])
print(sheet.iloc[0,1])
print(sheet.iloc[0,2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment