Dataframe Colors

Changing the color and style of the dataframe within Mito.

Setting dataframe colors allows you to change the colors of the displayed dataframes headers and rows. Dataframe formatting is the easiest way to make your dataframes presentable to colleages, for example if you are copying them into an email or slide deck.

Setting a Dataframe Format

  1. Click Format and then Set dataframe colors.

  2. In the Color Dataframe taskpane that opens, select a Suggested Style to change the color of your dataframe.

  3. You can also manually configure the Column Headers, Rows, or Dataframe Border by expanding these sections.

The Generated Styling Code

When you style your dataframe, Mito will generate code that styles this dataframe in your notebook. This code will look something like this:

# Formatted dataframes. Print these styling objects to see the formatted dataframe
forestfires_styler = forestfires.style\
    .set_table_styles([
        {'selector': 'thead', 'props': [('color', '#FFFFFF'), ('background-color', '#8F1B15')]},
        {'selector': 'tbody tr:nth-child(odd)', 'props': [('color', '#494650'), ('background-color', '#F0DADA')]},
        {'selector': 'tbody tr:nth-child(even)', 'props': [('color', '#494650')]},
])

To view your formatted dataframe in your notebook, simply display the forestfires_styler object. You can then copy this formatted dataframe anywhere you please.

Last updated