<jupyter_start><jupyter_text>QuestionYou can use openpyxl to read specific tables or ranges in a filefrom istivanMy questions : (1) Connect to a Table inside a file instead of to a range SO answer - https://stackoverflow.com/questions/43941365/openpyxl-read-tables-from-existing-data-book-example<jupyter_code>from openpyxl import load_workbook
from pathlib import Path
import pandas as pd
src_file = Path.cwd() / 'data' / 'raw' / 'shipping_tables_v2.xlsx'
wb = load_workbook(filename = src_file)
wb.sheetnames
sheet = wb['sales_vlookup']
sheet
lookup_table = sheet.tables['Table1']
lookup_table
lookup_table.ref
data = sheet[lookup_table.ref]
rows_list = []
for row in data:
    # Get a list of all columns in each row
    cols = []
    for col in row:
        cols.append(col.value)
    rows_list.append(cols)

# Create a pandas dataframe from the rows_list. 
# The first row is the column names
df = pd.DataFrame(data=rows_list[1:], index=None, columns=rows_list[0])
df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09580838323353294, 'fraction_numerical': 0.012974051896207584, 'mean_word_length': 4.797687861271676, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '483117', 'license': 'MIT', 'n_tokens_mistral': 345, 'n_tokens_neox': 334, 'n_words': 100, 'path': 'webcast_materials/04-table-lookup.ipynb', 'repo_name': 'ctdorris/excel-to-python-course', 'size': '1002'}