Skip to content

Instantly share code, notes, and snippets.

@rcsmit
Created October 10, 2022 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcsmit/d342e15488ee1d840ae9e4e42da67320 to your computer and use it in GitHub Desktop.
Save rcsmit/d342e15488ee1d840ae9e4e42da67320 to your computer and use it in GitHub Desktop.
import pandas as pd
from openpyxl import load_workbook
import urllib.request
local = False
if local:
excel_file = r"C:\Users\rcxsm\Documents\python_scripts\streamlit_scripts\input\dummy_occupation.xlsx"
wb = load_workbook(excel_file, data_only=True)
else:
excel_file = r"https://github.com/rcsmit/streamlit_scripts/blob/main/input/dummy_occupation.xlsx?raw=true"
urllib.request.urlretrieve(excel_file, "test.xlsx")
wb = load_workbook("test.xlsx", data_only=True)
sh_2022 = wb["TEST"] # test is the sheetname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment