{"id":19916,"date":"2021-02-07T22:38:12","date_gmt":"2021-02-08T03:38:12","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/?p=19916"},"modified":"2021-02-09T21:25:24","modified_gmt":"2021-02-10T02:25:24","slug":"how-to-use-ipywidgets-interactive-as-used-in-the-project","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=19916","title":{"rendered":"How to use ipywidgets, interactive as used in the project"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><a href=\"https:\/\/medium.com\/@SayedAhmedCanada?source=post_page-----4b20fe5c0b4d--------------------------------\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/miro.medium.com\/fit\/c\/96\/96\/1%2AqIditOG5oO0RmWRR7Iw4bA.png?w=750&#038;ssl=1\" alt=\"Justetc Social Services (non-profit)\"\/><\/a><\/figure>\n\n\n\n<p><a href=\"https:\/\/medium.com\/@SayedAhmedCanada?source=post_page-----4b20fe5c0b4d--------------------------------\">Justetc Social Services (non-profit)<\/a><a href=\"https:\/\/medium.com\/health-system-performance\/how-to-use-ipywidgets-interactive-as-used-in-the-project-4b20fe5c0b4d?source=post_page-----4b20fe5c0b4d--------------------------------\">Jan 31<\/a>&nbsp;\u00b7&nbsp;1&nbsp;min read<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from __future__ import print_function<br \/>from ipywidgets import interact, interactive, fixed, interact_manual<br \/>import ipywidgets as widgetsdef f(x):<br \/>    return xinteract(f, x=10);interactive(children=(IntSlider(value=10, description='x', max=30, min=-10), Output()), _dom_classes=('widget-\u2026interact(f, x=True);interactive(children=(Checkbox(value=True, description='x'), Output()), _dom_classes=('widget-interact',))interact(f, x='Hi there!');interactive(children=(Text(value='Hi there!', description='x'), Output()), _dom_classes=('widget-interact',))@interact(x=True, y=1.0)<br \/>def g(x, y):<br \/>    return (x, y)interactive(children=(Checkbox(value=True, description='x'), FloatSlider(value=1.0, description='y', max=3.0, \u2026interact(f, x=['apples','oranges']);interactive(children=(Dropdown(description='x', options=('apples', 'oranges'), value='apples'), Output()), _do\u2026from IPython.display import display<br \/>def f(a, b):<br \/>    display(a + b)<br \/>    return a+bw = interactive(f, a=10, b=20)type(w)ipywidgets.widgets.interaction.interactivew.children(IntSlider(value=10, description='a', max=30, min=-10),<br \/> IntSlider(value=20, description='b', max=60, min=-20),<br \/> Output())display(w)interactive(children=(IntSlider(value=10, description='a', max=30, min=-10), IntSlider(value=20, description='\u2026<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Justetc Social Services (non-profit)Jan 31&nbsp;\u00b7&nbsp;1&nbsp;min read from __future__ import print_functionfrom ipywidgets import interact, interactive, fixed, interact_manualimport ipywidgets as widgetsdef f(x): return xinteract(f, x=10);interactive(children=(IntSlider(value=10, description=&#8217;x&#8217;, max=30, min=-10), Output()), _dom_classes=(&#8216;widget-\u2026interact(f, x=True);interactive(children=(Checkbox(value=True, description=&#8217;x&#8217;), Output()), _dom_classes=(&#8216;widget-interact&#8217;,))interact(f, x=&#8217;Hi there!&#8217;);interactive(children=(Text(value=&#8217;Hi there!&#8217;, description=&#8217;x&#8217;), Output()), _dom_classes=(&#8216;widget-interact&#8217;,))@interact(x=True, y=1.0)def g(x, y): return (x, y)interactive(children=(Checkbox(value=True, description=&#8217;x&#8217;), FloatSlider(value=1.0, description=&#8217;y&#8217;, max=3.0, \u2026interact(f, x=[&#8216;apples&#8217;,&#8217;oranges&#8217;]);interactive(children=(Dropdown(description=&#8217;x&#8217;, options=(&#8216;apples&#8217;, &#8216;oranges&#8217;), value=&#8217;apples&#8217;), Output()), _do\u2026from &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=19916\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1903,1894,1919,182],"tags":[],"class_list":["post-19916","post","type-post","status-publish","format-standard","hentry","category-data-visualization","category-health-system-performance","category-visualize-health-system-performance","category---blog","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":19914,"url":"http:\/\/bangla.sitestree.com\/?p=19914","url_meta":{"origin":19916,"position":0},"title":"IPywidgets, interactive","author":"Sayed","date":"February 7, 2021","format":false,"excerpt":"Justetc Social Services (non-profit)\u00b7Jan 31 from __future__ import print_functionfrom ipywidgets import interact, interactive, fixed, interact_manualimport ipywidgets as widgetsdef f(x): return xinteract(f, x=10);interactive(children=(IntSlider(value=10, description='x', max=30, min=-10), Output()), _dom_classes=('widget-\u2026interact(f, x=True);interactive(children=(Checkbox(value=True, description='x'), Output()), _dom_classes=('widget-interact',))interact(f, x='Hi there!');interactive(children=(Text(value='Hi there!', description='x'), Output()), _dom_classes=('widget-interact',))@interact(x=True, y=1.0)def g(x, y): return (x, y)interactive(children=(Checkbox(value=True, description='x'), FloatSlider(value=1.0, description='y', max=3.0, \u2026interact(f, x=['apples','oranges']);interactive(children=(Dropdown(description='x', options=('apples',\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"http:\/\/bangla.sitestree.com\/?cat=1903"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":19920,"url":"http:\/\/bangla.sitestree.com\/?p=19920","url_meta":{"origin":19916,"position":1},"title":"health_status_visualizations, Health System Performance, Canada and Others","author":"Sayed","date":"February 7, 2021","format":false,"excerpt":"Justetc Social Services (non-profit)Jan 31\u00a0\u00b7\u00a04\u00a0min read import pandas as pdimport matplotlib.pyplot as plt%matplotlib inlinefrom __future__ import print_functionfrom ipywidgets import interact, interactive, fixed, interact_manualimport ipywidgets as widgetshealth_status = pd.read_excel('..\/data\/health-status.xls')health_status.head() health_status.set_index(['Indicator'])#health_status.loc[health_status['Cancer Mortality (F)']]#health_status.index.unique()indicators = pd.Index(health_status['Indicator']).unique()years = health_status['Data year'].unique()indicators[0], years[0]('Cancer Mortality (F)', '2013')cancer_mortality_2013 = health_status.loc[ (health_status['Indicator'] == indicators[0]) & (health_status['Data year'] == years[0])\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"http:\/\/bangla.sitestree.com\/?cat=1903"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":19922,"url":"http:\/\/bangla.sitestree.com\/?p=19922","url_meta":{"origin":19916,"position":2},"title":"interactive_health_status_visualizations, Health System Performance, Canada and Others","author":"Sayed","date":"February 7, 2021","format":false,"excerpt":"Justetc Social Services (non-profit)Jan 31\u00a0\u00b7\u00a05\u00a0min read import pandas as pdimport matplotlib.pyplot as plt%matplotlib inlinefrom __future__ import print_functionfrom ipywidgets import interact, interactive, fixed, interact_manualimport ipywidgets as widgetshealth_status = pd.read_excel('..\/data\/health-status.xls')health_status.head() # find all indicatorshealth_status.set_index(['Indicator'])indicators = pd.Index(health_status['Indicator']).unique()# find all yearsyears = health_status['Data year'].unique()indicators[0], years[0]('Cancer Mortality (F)', '2013')# sort yearsyears = [ int(aYear) for\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"http:\/\/bangla.sitestree.com\/?cat=1903"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":19924,"url":"http:\/\/bangla.sitestree.com\/?p=19924","url_meta":{"origin":19916,"position":3},"title":"non_med_determinants_visualizations, Health System Performance, Canada and Others","author":"Sayed","date":"February 7, 2021","format":false,"excerpt":"Justetc Social Services (non-profit)Jan 31\u00a0\u00b7\u00a05\u00a0min read import pandas as pdimport matplotlib.pyplot as plt%matplotlib inlinefrom __future__ import print_functionfrom ipywidgets import interact, interactive, fixed, interact_manualimport ipywidgets as widgetsnon_med_determinants = pd.read_excel('..\/data\/non-med-determinants.xls')non_med_determinants.head() # find all indicatorsnon_med_determinants.set_index(['Indicator'])indicators = pd.Index(non_med_determinants['Indicator']).unique()# find all yearsyears = non_med_determinants['Data year'].dropna().unique()indicators[0], years('Alcohol Consumption: Adults', array(['2014', '2015', '2013', 2015, 'Not applicable', '2016'],\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"http:\/\/bangla.sitestree.com\/?cat=1903"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":19918,"url":"http:\/\/bangla.sitestree.com\/?p=19918","url_meta":{"origin":19916,"position":4},"title":"access_to_care, primary-prescribing, Health System Performance, Canada and Others","author":"Sayed","date":"February 7, 2021","format":false,"excerpt":"Justetc Social Services (non-profit)Jan 31\u00a0\u00b7\u00a05\u00a0min read import pandas as pdimport matplotlib.pyplot as plt%matplotlib inlinefrom __future__ import print_functionfrom ipywidgets import interact, interactive, fixed, interact_manualimport ipywidgets as widgetsaccess_to_care = pd.read_excel('..\/data\/access-to-care.xls')access_to_care.head() # find all indicatorsaccess_to_care.set_index(['Indicator'])indicators = pd.Index(access_to_care['Indicator']).unique()# find all yearsyears = access_to_care['Data year'].dropna().unique()indicators[0], years('Inability to Pay for Medical Bills', array(['2016', 2016, 'Not applicable',\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"http:\/\/bangla.sitestree.com\/?cat=1903"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":19926,"url":"http:\/\/bangla.sitestree.com\/?p=19926","url_meta":{"origin":19916,"position":5},"title":"patient-safety, Health System Performance, Canada and Others","author":"Sayed","date":"February 7, 2021","format":false,"excerpt":"Justetc Social Services (non-profit)Jan 31\u00a0\u00b7\u00a05\u00a0min read import pandas as pdimport matplotlib.pyplot as plt%matplotlib inlinefrom __future__ import print_functionfrom ipywidgets import interact, interactive, fixed, interact_manualimport ipywidgets as widgetspatient_safety = pd.read_excel('..\/data\/patient-safety.xls')patient_safety.head() # find all indicatorspatient_safety.set_index(['Indicator'])indicators = pd.Index(patient_safety['Indicator']).unique()# find all yearsyears = patient_safety['Data year'].dropna().unique()indicators[0], years('Foreign Body Left In', array([2015, '2014\u20132015', 'Not applicable', 2014], dtype=object))#\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"http:\/\/bangla.sitestree.com\/?cat=1903"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/19916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19916"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/19916\/revisions"}],"predecessor-version":[{"id":19917,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/19916\/revisions\/19917"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19916"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}