---
title: "Export data for analytics"
description: "Export Pixeltable tables and queries to CSV, JSON, and Apache Iceberg for spreadsheets, scripts, and the lakehouse."
url: "https://www.pixeltable.com/notebooks/data-export-analytics"
updated: "2026-07-15"
---

# Export data for analytics

Export Pixeltable tables and queries to CSV, JSON, and Apache Iceberg for spreadsheets, scripts, and the lakehouse.

- **Type:** Notebook
- **Group:** Data Import/Export

## How it works

Pixeltable's export helpers live in the pxt.io module, one function per destination. Here's how each handles the three factors above:

export_iceberg() streams into an Apache Iceberg catalog you supply; the other two write a single file.

## What it covers

- Export a table or filtered query to CSV, JSON, and Apache Iceberg
- Keep media references portable instead of writing local file paths
- Use advanced Iceberg options for existing tables, embeddings, and type overrides

## What it uses

- **Install:** `pip install pixeltable pyiceberg`
- **Pixeltable calls:** `pxt.create_table()`, `insert()`, `add_computed_column()`

## A look at the code

```python
images.add_computed_column(width=pxtf.image.width(images.image))
images.add_computed_column(height=pxtf.image.height(images.image))
images.add_computed_column(mode=pxtf.image.mode(images.image))

# The derived columns we'll export
features = images.select(
    images.label, images.width, images.height, images.mode
)
features.collect()
```

## Open it

- **Open in Colab:** https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/data/data-export-analytics.ipynb
- **Docs page:** https://docs.pixeltable.com/howto/cookbooks/data/data-export-analytics
- **Source on GitHub:** https://github.com/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/data/data-export-analytics.ipynb
