Altair
Altair (Vega-Altair) is a Python package for making charts by describing them: you say which column goes on each axis, color or size, and it writes the Vega-Lite that draws the chart.
Every Altair chart has the same three parts, chained with dots:
alt.Chart(df).mark_point().encode(x='gdp_per_capita:Q', y='life_expectancy:Q')The data (alt.Chart(df)), a mark (.mark_point()) and an encoding that maps columns onto the chart (.encode(...)). If you know ggplot2, it's the same grammar-of-graphics idea in Python. By convention it's imported as alt.
Learn more
Related terms
- Vega-Lite
Vega-Lite is a language for describing charts in JSON: you name the data, the mark and which column goes on each axis, and a renderer draws it. Altair writes Vega-Lite for you.
- pandas
pandas is a Python package for working with tables of data, called DataFrames: loading them, filtering rows, picking columns and summarizing them.
- JSON
JSON is a text format for structured data: labels and values inside curly braces, lists inside square brackets. Programs use it to pass data to each other.