In Vega-Lite, a tooltip is an encoding to which variables are attached.

The Altair Python package offers us a shortcut to specify the tooltip encoding, by supplying the names of the variables we wish to appear in the tooltip. Altair and Vega-Lite apply some default behaviors.

You can use the alt$Tooltip() method to achieve the same outcome:

Although it is more verbose than the shorthand form, it does allow you to be more expressive:

If there is no aggregation or time-unit specified, Vega-Lite will use the variable-name as the title for the field. Otherwise, Vega-Lite will modify the variable-name to indicate the time-unit or the aggregation. You can use the title option to override the default that Vega-Lite will propose.

Also, you can specify the format of the values using the format option. For quantitative variables, d3-format is used; for temporal variables, d3-time-format is used.