jupyter-notebook

How to link a multiselect widget to a datatable using bokeh in a jupyter notebook?

最后都变了- 提交于 2019-12-24 07:13:20
问题 I'm attempting to connect a datatable with a multiselect widget in bokeh. I've searched around and gathered that I need to develop a function to update the data source for the data table, but I seem to have two problems. I cannot seem to access the value of the multiselect object after I click it. I cannot seem to push the change to the notebook after receiving the change. Here's an example of my code: import pandas as pd from bokeh.io import push_notebook from bokeh.plotting import show,

How to pause Jupyter Notebook widgets, waiting for user input

橙三吉。 提交于 2019-12-24 07:06:29
问题 In my notebook I've a loop in which I want to ask the user to binary "Yes" or "No". On this choice the algorithm is suppposed to continue. for i in range(n_total): display.clear_output(wait=True) waiting_for_scoring = True print("True or False?") display.display(widgets.HBox((true_button, false_button))) a = true_button.on_click(on_true_button) a = false_button.on_click(on_false_button) while waiting_for_scoring == True: #waiting for user input pass How can I make the loop to wait, after the

The Cython module is not an IPython extension

て烟熏妆下的殇ゞ 提交于 2019-12-24 06:48:26
问题 When trying to load Cython extension from my Jupiter notebook %load_ext Cython I get the below message: The Cython module is not an IPython extension I did not have this problem a couple of weeks ago, when I wrote a Cython extension on my nb. I have tried to upgrade ipython and cython both from my regular environment (I am using a Mac running 10.11) and from Anaconda, with no success. Any tips? Thanks a lot! 回答1: Cython is not an IPython extension, so %load_ext won't work on it. You can still

Error while using Graphlab Create Jupyter

回眸只為那壹抹淺笑 提交于 2019-12-24 06:47:12
问题 I have recently upgraded the Graph Lab create version that I had. While running codes using the Jupyter console I came up with the following errors: from __future__ import division import graphlab import math import string **Error: ACTION REQUIRED: Dependencies libstdc++-6.dll and libgcc_s_seh-1.dll not found. 1. Ensure user account has write permission to C:\Anaconda3\envs\gl-env\lib\site-packages\graphlab 2. Run graphlab.get_dependencies() to download and install them. 3. Restart Python and

Writing a function that returns and prints the maximum value, out of all the values in a column

ε祈祈猫儿з 提交于 2019-12-24 06:35:43
问题 I've got this table: A DataFrame table which is made by using Jupyter Notebook. This is actually only part of the table. The complete table is actually a .csv file, and by using .head() function, only the first five rows are shown. I need to write a function that returns and prints the maximum value, out of all the values in the second column, which its label is 'Gold'. That function should return a single string value. I looked up at several sources before writing my question, trying many

Tracking progress in python list(map(…))

风格不统一 提交于 2019-12-24 04:34:09
问题 I am attempting to track progress in the following code: from toolz import compose calculator = compose(my_function, list, my_dict.get, tuple) result = list(zip(*map(calculator, my_values))) my_values is a list of length ~1mio. My first attempt is to add a counter to my_function that increments and print it out when a multiple of X (e.g. X==500 ) is reached. Is there a pythonic or cleaner way to achieve this, i.e. without adding lots of counters to various loops? A progress bar in jupyter

How to plot the graph in more accurate way?

风格不统一 提交于 2019-12-24 02:08:06
问题 I have a data set that consists of 1440 rows × 297 columns . I tried to plot 03_jan_2018 in terms of Time(X-Axis) and Density (Y-Axis), but I'm faced with a problem. The outcome graph is not enough clear and also the X-Axis is not appeared!! I would like to make something like this: But I'm ending up with this: Can anyone help me? Thanks in advance! 回答1: An easy fix for this is to increase the figure size. plt.figure(figsize=(80,40)) plt.plot(data.hour_formatted, data['03_jan_18']) plt.show()

Changing Jupyter Notebook start up folder by modifying “start in” not working any more

时光毁灭记忆、已成空白 提交于 2019-12-24 01:54:50
问题 I used to be able to change the default start up folder for Jupyter (the folder Jupyter displays in browser when it was first started) by modifying the "start in" option of the Notebook launch icon's properties on Windows, as described here and here. However, this is not working any more after I recently installed Anaconda 3. Even though I changed the "start in" folder to the folder I wish, the browser still goes to "Documents" folder by default. I tried doing this as admin, still didn't work

Altair interactive line plot, make line pop and highlighted when clicking icon on the right

不羁岁月 提交于 2019-12-24 01:49:13
问题 I had been trying to make with some interactive plot using Altair on jupyter lab. I had reached this stage where the results is below. As you can see, the line doesnt pop to the front when its highlighted. How do I make it pop to the front? Attached is the code. import altair as alt source = df selection = alt.selection_multi(fields=['class'], on='click') color = alt.condition(selection, alt.Color('class:O', legend=None, scale=alt.Scale(scheme='category10')), alt.value('lightgray')) base =

Importing wordcloud using Jupyter Notebook (Python)

最后都变了- 提交于 2019-12-24 01:45:31
问题 I am using jupyter Notebook(conda root). The python version I am running is 2.7 I am having a hard time getting wordcloud installed into my environment. Here's the code from wordcloud import WordCloud But I got this error: ImportErrorTraceback (most recent call last) <ipython-input-21-8038e19af624> in <module>() ----> 1 from wordcloud import WordCloud C:\Users\aneeq\Anaconda2\lib\site-packages\wordcloud\__init__.py in <module>() ----> 1 from .wordcloud import (WordCloud, STOPWORDS, random