lundi 29 novembre 2021

Checkbox in Dropdown Jupyter Widget Python

I have a Dataframe with one column , "Intimation month" in it.

Index Intimation Month 0 6 1 8 2 9 3 9 4 9 .. 24856 8 24857 9 24858 9 24859 8 24860 8

I want to create a dropdown with unique values of Intimation month and checkbox should be enabled in the dropdown because I want to select multiple months in the dropdown and then continue with further processing.

I wrote the below code for dropdown with unique values of months but I want checkboxes corresponding to a month number.

from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets

months=df['Intimation month'].dt.month
months= set(months)

w=widgets.Dropdown(
    options= [i for i in months],
    value= None,
    description='Month:',
)

display(w)



Aucun commentaire:

Enregistrer un commentaire