Questions tagged [ipywidgets]

IPython widgets for the Jupyter Notebook

Read the docs

ipywidgets on github

973 questions
5
votes
1 answer

Jupyter Ipywidgets - How to clear cell output before re-printing the output

Using Python 3.7 in a Jupyter notebook, the code below shows a text entry field that triggers the handle_submit function to print out some output. In this example 40 repetitions of the input. from ipywidgets import widgets from IPython.display…
576i
  • 7,579
  • 12
  • 55
  • 92
5
votes
1 answer

Change button name on ipywidgets

Is there a way to easily change the button name in the ipywidgets module? I am using the decorator, but cannot find in the documentation how to change the name to something other than "Run Interact". I believe I need to use the decorator since my…
kashmoney
  • 412
  • 1
  • 5
  • 17
5
votes
1 answer

Getting Ipywidgets To Interact With Pandas Dataframe In Jupyter Notebook

Hi I'm trying to get a graph to function with ipywidgets in a Jupyter notebook but am having no such luck. I would like to get the widgets to update based on the dataframe when the update button is functioned. Does anybody know where I am going…
Ryan
  • 109
  • 2
  • 10
5
votes
2 answers

How to check if a Jupyter Notebook extension is enabled?

I would like to programmatically check from a Jupyter Notebook if ipywidgets is enabled. What ways are there to do so? I tried looking into nbextensions and notebook modules, but did not find a function to list enabled extensions. My Notebook is on…
Mace Ojala
  • 335
  • 4
  • 9
5
votes
2 answers

How to change the default position of a ipywidget slider to the side of a matplotlib figure?

I am looking into a way to change the position of the vertical IntSlider to the right of the matplotlib fig. Here is the code: from ipywidgets import interact, fixed, IntSlider import numpy as np from matplotlib import pyplot as plt %matplotlib…
5
votes
2 answers

Python ipywidgets checkbox events

I am using ipywidgets.widgets.Checkbox. Is there any way to handle the checkbox events? Please do help. I am a beginner. edit: How to create a list of checkboxes?
Sudharsan
  • 53
  • 1
  • 1
  • 5
5
votes
2 answers

ipywidgets: avoid flickering when using interact

I made a figure with four subplots of a histogram based on random normal, gamma, exponential, and uniform distributions respectively. I made it using matplotlib and Jupyter notebook. It is an interactive figure via ipywidgets lib. In particular,…
Antonio Serrano
  • 882
  • 2
  • 14
  • 27
5
votes
1 answer

Adjust the Space Between Two Jupyter Widgets

I'm trying to create a Jupyter Notebook to help some colleagues interactively access some data. I want to give them a bunch of widgets that allow them to use different criteria to filter the data. Mainly it works beautifully, but I can't adjust…
Batman
  • 8,571
  • 7
  • 41
  • 80
5
votes
4 answers

How to get wider text for Checkbox widget?

How can I configure the ipywidgets Checkbox for long text strings as in, c = Checkbox(description=' this is some very long very long text',value=False) and not get the text to be squeezed and wrapped in the encompassing Jupyter notebook? Thanks!
reckoner
  • 2,861
  • 3
  • 33
  • 43
5
votes
2 answers

Sharing Interactive IPython/Jupyter Notebooks for Non-Technical Users

Is there an optimal way to share/serve a readonly-ish Jupyter notebooks with the input code cells hidden, but connected to a live kernel so users can interact with widgets? I understand there are ways to embed data for widgets, but often the…
econgineer
  • 1,117
  • 10
  • 20
5
votes
2 answers

How to have an argument possible values dependent on another argument with IPython Widgets?

Assume I have this simple function in Python: def f(gender, name): if gender == 'male': return ranking_male(name) else: return ranking_female(name) where gender belongs to ['male', 'female'] whereas name belongs to ['Adam',…
gota
  • 2,338
  • 4
  • 25
  • 45
5
votes
1 answer

Return value from function where ipython widgets are used to obtain input parameters

I'm trying to "widgetize" my IPython notebooks and am running into trouble with events and returning values from a function. This is the workflow I'm thinking is the best way to go: using widgets to get the input values for an arbitrary…
Benjamin Bowen
  • 121
  • 1
  • 8
4
votes
1 answer

ipywidgets button onclick event is not raising the onclick method

import ipywidgets as widgets button = widgets.Button(description="Click Me!") output = widgets.Output() display(button, output) def on_button_clicked(): print("button clicked") button.on_click(on_button_clicked) The button shows up.. but…
psj01
  • 3,075
  • 6
  • 32
  • 63
4
votes
1 answer

How do I set the width of the input field of an IntText widget in ipywidgets?

I create an IntText widget like this: import ipywidgets as widgets widgets.IntText(value=12, description='CTR1_0', style={'description_width': 'initial'}) When I include this widget in an HBox in a Tab, the text box is much larger…
Lars Ericson
  • 1,952
  • 4
  • 32
  • 45
4
votes
1 answer

Use huggingface transformers without IPyWidgets

I am trying to use the huggingface transformers library in a hosted Jupyter notebook platform called Deepnote. I want to download a model through the pipeline class but unfortunately deepnote does not support IPyWidgets. Is there a way to disable…