Import data from CSV files

Load data from CSV and Excel files into Pixeltable tables for processing and analysis.

Data Import/Export · Notebook · Updated

Colab runs it in your browser. If it calls a model provider, it asks for that provider's API key in a cell.

How it works

You use pxt.create_table() with a source parameter to create a table from a CSV file, or insert DataFrame rows into an existing table.

What it covers

  • Import CSV files directly into tables
  • Import from Pandas DataFrames
  • Handle different data types

What it uses

Install
terminal
pip install pixeltable pandas
Pixeltable calls
pxt.create_table()insert()

A look at the code

data-import-csv.ipynb
# Import CSV from URL
csv_url = 'https://raw.githubusercontent.com/pixeltable/pixeltable/main/docs/resources/world-population-data.csv'
population = pxt.create_table('import_demo/population', source=csv_url)

One cell of the notebook, copied as it is. Open it in Colab for the rest.

Browse all 103