This documentation page is also available as an interactive notebook. You can launch the notebook in
Kaggle or Colab, or download it for use with an IDE or local Jupyter installation, by clicking one of the
above links.
Load data from Excel spreadsheets (.xlsx) into Pixeltable tables.
Problem
You have data in Excel format that needs to be loaded for AI
processing—reports, inventory lists, or business data exported from
other systems.
Solution
What’s in this recipe:
Import Excel files directly into tables
Handle multiple sheets
Override column types when needed
You use pxt.create_table() with an Excel file path as the source
parameter. Pixeltable infers column types automatically.
# Create a fresh directorypxt.drop_dir('excel_demo', force=True)pxt.create_dir('excel_demo')
Connected to Pixeltable database at: postgresql+psycopg://postgres:@/pixeltable?host=/Users/pjlb/.pixeltable/pgdata
Created directory ‘excel_demo’.
<pixeltable.catalog.dir.Dir at 0x30b6cb730>
# Import Excel file directlyorders = pxt.create_table( 'excel_demo/orders', source=str(excel_path), source_format='excel', # Hint for Excel format)
Created table ‘orders’.Inserting rows into `orders`: 0 rows [00:00, ? rows/s]
Inserting rows into `orders`: 5 rows [00:00, 501.21 rows/s]
Inserted 5 rows with 0 errors.
# View imported dataorders.collect()
Add computed columns
# Add computed column for order totalorders.add_computed_column(total=orders.quantity * orders.price)