IPython widgets for the Jupyter Notebook
Questions tagged [ipywidgets]
973 questions
0
votes
1 answer
I cannot access dropdown widget output in a loop
I have been going in circles for hours.
I am trying to get the dropdown output to loop, to ensure the result is correct.
I get the dropdown list, but the "output" is none.
If I select 'DEV' or "DEV", it prints DEV. The output (w) is none and the…

Clives-online
- 37
- 8
0
votes
1 answer
How to include the ipywidgets interact code in my own function
For example, I define my own function "f":
def f(x):
return x
and I want to make it interactable, so I wrote another function "F":
from ipywidgets import interact
def F():
interact(f,x=10)
but it didn't work. Any ideas about how I can…

JackeyOL
- 313
- 2
- 16
0
votes
2 answers
Python exec(script, globals()) not showing GUI (iPyWidgets)
Hello my fellow programmers,
I want to include a script from another file that creates a UI with iPyWidgets.
The problem is that the code will execute but nothing is shown. I am using Jupyterhub to display the button.
When I run the code on itself,…

Derek Haynes
- 125
- 1
- 2
- 13
0
votes
1 answer
Python: Interact Dropdown - how to reference the output
Hi I have below dropdown:
from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets
def f(Books):
return Books
interact(f, Books=['a','b','c','d']);
This populates a dropdown list allowing user to…

Michael Yoo
- 49
- 7
0
votes
1 answer
Combobox widget from ipywidget is not working
I have installed the latest ipywidgets version 7.5.1 and I use Jupyter nb version 6.0.2. Other ipywidgets work well. But I do not get any output with the Combobox. No error messages.
widgets.Combobox(# value='John', placeholder='Choose Someone',…

arr0w
- 41
- 1
- 6
0
votes
2 answers
if statment not working with python widget
I am working on a Jupyter Notebook in which I am creating a tab widget in python using the following code:
import ipywidgets as widgets
tab_contents = ['P0', 'P1']
children = [widgets.Text(description=name) for name in tab_contents]
tab =…

GCGM
- 901
- 1
- 17
- 38
0
votes
1 answer
Is it possible to pass streams.Selection1D value to ipywidgets?
I saw examples of pyviz streams with hv.DynamicMap only.
I need to visualize selected items streams.Selection1D() from hv.Nodes() stream - on some kind of Label or TextArea - not on DynamicMap object.
Is it possible?

Dimas51
- 19
- 3
0
votes
2 answers
The ipywidgets function FileUpload is not found when run on Jupyter notebook
From the ipywidgets guide for users I copied and run
import ipywidgets as widgets
widgets.FileUpload(
accept='', # Accepted file extension e.g. '.txt', '.pdf', 'image/*', 'image/*,.pdf'
multiple=False # True to accept multiple files…

user17161
- 21
- 2
0
votes
0 answers
ipywidgets incomatible with Python 3.8
Is there a conda version of "ipywidgets" which is compatible with Python 3.8 ?
I am getting the following error while trying to install using "conda install -c anaconda ipywidgets".
Error : UnsatisfiableError: The following specifications were…
0
votes
0 answers
Create save png button to ipywidgets
I have a function to display my classification tree as an ipywidgets as below:
labels = X.columns
#functions to create and fit the decision tree
def plot_tree(criterion, depth, split, min_split, min_leaf=0.2):
#create tree
clf =…

lela_rib
- 147
- 2
- 10
0
votes
1 answer
How to dynamically read out a widget state in Ipython notebook
Is there a way to create a widget in an Ipython notebook and to read out the state of this widget at a different position in the code?
I tried using
from ipywidgets import interact
def f(x):
pass
interact(f,x=True)
As a result, f(x) is executed…

Jann
- 635
- 1
- 6
- 17
0
votes
1 answer
Control of layout ipywidgets in jupyter notebook
I have some problems understanding how to control the flexbox of ipywidgets in jupyter notebook. According to the docs this should be possible, however my styling code (see below) does not result in the desired layout. I checked on stack and found a…

cvanelteren
- 1,633
- 9
- 16
0
votes
2 answers
When is a widget property available to an iPython / Jupyter cell?
I'm getting ready to create a communications widget for use in a Jupyter application. I'm trying to understand when the widget's "value" property can be accessed ... it looks like the "value" can be read anytime, but won't match the widget model…

bdemchak
- 263
- 2
- 10
0
votes
0 answers
Where is the message queue for a Jupyter ipywidget?
I have an interactive plot, using matplotlib and ipywidgets, that is painfully slow, and so the display lags behind the interaction. One way to fix this is to tell my widget to be continuous_update=False, but I don't want to do this -- I like the…

DamonJW
- 3,342
- 2
- 24
- 29
0
votes
1 answer
jupyter ipywidgets doesn't show function return value
I used the most simply example :
from ipywidgets import interact, widgets
from IPython.display import display
# this is a sample function
def myfunc(x):
display(x*2) # I add this for testing
print(x*2) # I add this for testing
return…

Mithril
- 12,947
- 18
- 102
- 153