Calmcode - pigeon: dataframes


1 2 3 4

You can also annotate a dataframe. To run the code, remember to first run install the dependency for the dataset.

python -m pip install scikit-lego

Once the dataset is available you can run the code below.

from IPython.display import display
from sklego.datasets import load_penguins
from pigeon import annotate

df = load_penguins(as_frame=True).drop(columns=["species"])

# Again note the clever use of the `display_fn`.
annotations = annotate(
  [1, 2, 3, 4, 5, 6],
  options=['A', 'B', 'C'],
  display_fn=lambda x: display(df.iloc[x-1:x])