Last active
May 20, 2021 23:21
-
-
Save Dhrumilcse/1b90deab1c94db543b135a41946ce942 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def filter_data(data): | |
# Creating Dropdowns and buttons | |
dropdown_currency = widgets.Dropdown(options=data.currency.unique(), description='Currency:') | |
# Event handler for dropdowns | |
def dropdown_currency_eventhandler(change): | |
common_filtering(data, change.new) | |
#Call | |
dropdown_currency.observe(dropdown_currency_eventhandler, names='value') | |
#Layout box | |
input_widgets = widgets.HBox([dropdown_currency]) | |
with filter_toggle_output: | |
display(input_widgets) | |
def common_filtering(data, currency): | |
common_filter = data[(data.currency == currency)] | |
with data_output: | |
display(common_filter) | |
return common_filter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment