Altair • Top
Install Altair using pip . It is highly recommended to work within a Jupyter notebook environment (JupyterLab, VS Code, Colab) for automatic rendering.
Altair allows you to transform data directly within the chart definition, such as calculating averages or sums, using mean , sum , count , etc.. altair
Altair works best with tidy data—long-form data where each row is an observation and each column is a variable. Install Altair using pip
Learn how to (e.g., lines and points)?
If your data relies on a pandas index, use .reset_index() before passing it to Altair. such as calculating averages or sums
You can save your chart as a JSON file (Vega-Lite spec) or render it as an image/HTML file. chart.save('chart.html') Use code with caution. Copied to clipboard