Python

Write and execute Python code with AI assistance, variable sharing, and Jupyter-like functionality

The Python cell lets you write and execute Python code directly inside your document — just like in Jupyter.

Getting started with Livedocs AI

Key Features

  • Write & Run Python Code
    Supports the full Python language. Any variables, functions, or data you define are available for use in other cells.

  • Expanded View
    Click the three-dot menu and select Expand for a fullscreen, focused coding experience.

  • AI Assistance
    Tag the cell in a new chat with your preferred model to get help writing or editing Python code.

  • Code & Output Toggles
    Collapse or expand the code editor and/or the output display to keep your document clean.

  • Variable Sharing
    Variables defined here can be referenced in:

    • Other Python cells
    • SQL queries ({{variable_name}} syntax)
    • Prompt cells
  • Jupyter-Like Functionality
    Includes support for:

    • Printing output
    • Displaying DataFrames
    • Creating charts and plots
    • Importing packages (within the available runtime)

Example

import polars as pl

df = pl.DataFrame({
    "name": ["Alice", "Bob", "Charlie"],
    "age": [25, 30, 35]
})

df

You can then use df in another cell:

SELECT * FROM df WHERE age > 30

This makes Python cells ideal for data cleaning, feature engineering, or any transformation before passing results downstream.