jupyter-notebook

What is the easiest way to create a webapp from an interactive Jupyter Notebook?

孤街浪徒 提交于 2019-12-12 09:04:15
问题 I have a Jupyter Notebook that plots some data and lets the user interact with it via a slider. What would be the easiest way to make a web app with a similar functionality? (reusing as much of the code...) 回答1: The Jupyter Dashboards Bundlers extension from the Jupyter Incubator is one way to do it while retaining interactivity. EDIT: While pip installing this package will also install the cms package dependency, like dashboard_bundlers , cms needs to be explicitly enabled/quick-setup as a

Pandas / IPython Notebook: Include and display an Image in a dataframe

旧巷老猫 提交于 2019-12-12 08:05:50
问题 I have a pandas Dataframe which also has a column with a filename of an image. How can I display the image inside of the DataFrame? I tried the following: import pandas as pd from IPython.display import Image df = pd.DataFrame(['./image01.png', './image02.png'], columns = ['Image']) df['Image'] = Image(df['Image']) But when I show the frame, each column only shows the to_string representation of the Image Object. Image 0 IPython.core.display.Image object 1 IPython.core.display.Image object Is

Syntax Highlighting in iPython Notebook Markdown Cell

六眼飞鱼酱① 提交于 2019-12-12 07:47:13
问题 Is there a way to get a Markdown cell in iPython Notebooks to highlight syntax in code blocks? For instance, in GitHub, one can get the desired effect via the following. ```python >>>print('hello') ``` 回答1: The GitHub Flavored Markdown-style of denoting code using the triple-backtick is now supported in IPython master branch on GitHub, and so will be included in the 1.0 release. As Jakob noted, even prior to this, you could use regular markdown for code, in which you just need to indent your

Jupyter windows shortcut corrupt by default

▼魔方 西西 提交于 2019-12-12 07:47:00
问题 After installing Anaconda, the Jupyter notebook shortcut works fine. Other stackoverflow answers have indicated that you can change the default working directory by changing the "Start In:" field in the shortcut properties. However, if Anaconda is installed in the suggested folder for single users C:\Users\whshg0\AppData\Local\Continuum\Anaconda3\ , then the Target field of the shortcut gets truncated when you edit the Start in field. Example: C:\Users\user01\AppData\Local\Continuum\Anaconda3

Pyspark read multiple csv files into a dataframe (OR RDD?)

二次信任 提交于 2019-12-12 07:19:41
问题 I've got a Spark 2.0.2 cluster that I'm hitting via Pyspark through Jupyter Notebook. I have multiple pipe delimited txt files (loaded into HDFS. but also available on a local directory) that I need to load using spark-csv into three separate dataframes, depending on the name of the file. I see three approaches I can take - either I can use python to somehow iterate through the HDFS directory (haven't figured out how to do this yet, load each file and then do a union. I also know that there

Jupyter with Anaconda on Windows will not run cells

[亡魂溺海] 提交于 2019-12-12 07:14:33
问题 I'm trying to run Jupyter Notebook for Anaconda 2.3.0 (64-bit) on Windows 7 (64-bit), under Python 2.7.11. Jupyter is not displaying syntax highlighting and the notebook isn't connected to the kernel, but it's not clear why. I'm running on Chrome. Small Edit: NotebookApp (from Windows CMD or from Anaconda command line) gives a "zmq message arrived on closed channel" message. I'm not clear if that's relevant. Bigger Edit: Based on comments below, I set c.NotebookApp.port = 8889 . 回答1: Looks

Replace / remove highlighting in Jupyter Notebook with custom theme

不想你离开。 提交于 2019-12-12 05:39:31
问题 It's clear that the selection is for readability, but it seems too glaring to me. A set of themes for Jupyter How can I edit the configuration and change the transparency or the color of the selected area (blue) or invert the selection to the bracket, or completely remove it? In css syntax I do not understand at all. 回答1: The CSS selector for matching brackets is div.CodeMirror span.CodeMirror-matchingbracket So, you can change the colour of the bracket itself and the background colour of the

ModuleNotFoundError: No module named 'matplotlib.pyplot'

你。 提交于 2019-12-12 05:14:04
问题 When making a plot, I used both Jupyter Notebook and Pycharm with the same set of code and packages. The code is: import pandas as pd import numpy as np import matplotlib.pyplot as plt # as in Pycharm import matplotlib as plt # as in Jupyter df = pd.read_csv("/home/kunal/Downloads/Loan_Prediction/train.csv") df['ApplicantIncome'].hist(bins=50) plt.show() #this only in Pycharm not in Jupyter. In Pycharm, the code works well. But in Jupyter Notebook, it has error: I wish someone can help me

discovering which kernel has been started

强颜欢笑 提交于 2019-12-12 04:54:23
问题 Environment : I am spawning Notebook Servers (version 5) in Docker Containers, and have a system where users may select one of several Notebook kernels (thus, docker images) they wish to start. I have a need to add an indicator to the notebook server page to indicate which particular kernel has been started. I already have templates that modify the page.html and tree.html templates, so can add whatever I need into the html no problem.... what I'm failing to work out is how I get some piece of

For Loop to create boxplots with Matplotlib

孤街浪徒 提交于 2019-12-12 04:43:44
问题 I am trying to loop through a list to create a series of boxplots using Matplotlib. Each item in the list should print a plot that has 2 boxplots, 1 using df1 data and 1 using df2 data. I am successfully plotting x1, but x2 is blank and I don't know why. I am using jupyter notebook with Python 3. Any help is appreciated! df1 = df[df.order == 1] df2 = df[df.order == 0] lst = ['device', 'ship', 'bill'] i = 0 for item in lst: plt.figure(i) x1= df1[item].values x2 = df2[item].values plt.boxplot(