ipywidgets

iPyWidget with date slider?

别来无恙 提交于 2020-06-09 17:53:10
问题 I am wondering if there's an easy way to build an iPyWidget with a datetime slider. Right now it is easy to slide over integer or floating point ranges (e.g. numbers 1-10, decimals 0.01, 0.02, ...). I imagine you could convert dates to floats or integers, build some sort of slider using these, and then convert back to dates for the display labels on the slider. However, this seems clunky. Does anyone have a smoother solution? 回答1: I had the same issue recently. I had to write my own class to

ImportError: cannot import name 'AppLayout' from 'ipywidgets'

时光怂恿深爱的人放手 提交于 2020-04-16 02:23:18
问题 While importing AppLayout I'm getting the following error. I am using Jupyter and have installed ipywidgets . The same error is being raised when importing GridspecLayout . Can anyone help me with this? All other imports from ipywidgets are working properly, atleast the ones I have imported. ImportError: cannot import name 'AppLayout' from 'ipywidgets' (C:\Appl\Anaconda3\lib\site-packages\ipywidgets\__init__.py) 回答1: Check you have the latest version of ipywidgets with help(ipywidgets) . 7.5

How can I overcome “Error: Object 'jupyter.widget' not found in registry”?

99封情书 提交于 2020-03-04 21:33:39
问题 I am running jupyterlab within jupyterhub on kubernetes. I am trying to display widgets using e.g. from ipywidgets import interact @interact(x=(0, 100, 10)) def p(x=50): pass Instead of the intended interactive widget, the lab notebook prints: interactive(children=(IntSlider(value=50, description='x', step=10), Output()), _dom_classes=('widget-interact... On inspection of the javascript console: default.js:129 Error: Object 'jupyter.widget' not found in registry at default.js:1474 at new

ipywidgets widgets values not changing

拜拜、爱过 提交于 2020-03-02 06:50:47
问题 I am trying to get output from my ipywidgets widgets in Microsoft Azure Notebooks running Jupyter Notebooks in Python 3.6. However, it does not return new values when I get them. This also applies to the event handlers/interact never being called for other widgets. I have tried putting in different initial values, using different types of widgets ( Text , Textarea , Checkbox , Button , ToggleButton ). I have tried getting the w.value , ipywidgets.interact , w.observe , and w.on_click on

graceful interrupt of while loop in ipython notebook

寵の児 提交于 2020-01-31 18:14:37
问题 I'm running some data analysis in ipython notebook. A separate machine collects some data and saves them to a server folder, and my notebook scans this server periodically for new files, and analyzes them. I do this in a while loop that checks every second for new files. Currently I have set it up to terminate when some number of new files are analyzed. However, I want to instead terminate upon a keypress. I have tried try-catching a keyboard interrupt, as suggested here: How to kill a while

graceful interrupt of while loop in ipython notebook

自古美人都是妖i 提交于 2020-01-31 18:14:29
问题 I'm running some data analysis in ipython notebook. A separate machine collects some data and saves them to a server folder, and my notebook scans this server periodically for new files, and analyzes them. I do this in a while loop that checks every second for new files. Currently I have set it up to terminate when some number of new files are analyzed. However, I want to instead terminate upon a keypress. I have tried try-catching a keyboard interrupt, as suggested here: How to kill a while

How to save state of ipython widgets in jupyter notebook using python code

岁酱吖の 提交于 2020-01-24 19:49:05
问题 I am using ipython widgets in my jupyter notebook. Now when kernel is restarted, the widget state is lost and a message is displayed: “Jupyter widget could not be displayed because the widget state could not be found. This could happen if the kernel storing the widget is no longer available, or if the widget state was not saved in the notebook. You may be able to create the widget by running the appropriate cells” So when a user reopens his notebook after a kernel restart, he doesn't find the

Embed widgets with jupyter-cadquery (threejs): wrong position on load

白昼怎懂夜的黑 提交于 2020-01-22 18:57:25
问题 I am using jupyter-cadquery to visualize some 3D models made with CadQuery. When visualizing the models on a Jupyter notebook, everything works as expected. But when trying to embed the widget in an HTML document, it seems the camera, on load, is pointing to (0, 0, 0) , not as expected. Once you interact with the widget, the camera will point to the expected coordinate. Here is the code to reproduce the error and an animation of the mentioned problem (see instructions bellow on how to

Clear output widget using onclick Button event - Python

我的未来我决定 提交于 2020-01-22 02:21:12
问题 I am working on a Jupyter Notebook in which I am using a button created with ipywidgets to display a df when clicking on it. For this I am using the following code: import ipywidgets as widgets import numpy as np vartest = 0 Button = widgets.Button(description='Search', disabled=False, button_style='info', tooltip='Search') display(Button) def whenclick2(b): global df if vartest==0: df = pd.DataFrame(np.arange(5)) class displayDF(object): def _create_widgets(self): self.button = Button self

Python onclick button widget return object

不羁的心 提交于 2020-01-15 02:55:07
问题 I am trying to build a file/data selector in jupyter notebooks with python. The idea is that I select some files and data channels in the files with the multipleSelect widget and then with a button return a dataFrame. How can I access the df_object? #stack example from ipywidgets import widgets from IPython.display import display from IPython.display import clear_output import pandas as pd import numpy as np filenames = ["file1", "file2"] file_dict = { "file1":pd.DataFrame(np.arange(5)),