jupyter-notebook

Import error while trying to run jupyter notebook

只愿长相守 提交于 2020-02-05 13:10:09
问题 An import error occurs when trying to run jupyter notebook I'm trying to run jupyter notebook using anaconda ( git bash platform), and as I type in jupyter notebook, an import error occurs every time. I tried to lauch it inside an environment, but the same error occured. $ jupyter notebook Traceback (most recent call last): File "C:\Users\User\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module> from notebook.notebookapp import main File "C:\Users\User\Anaconda3\lib\site

Import error while trying to run jupyter notebook

早过忘川 提交于 2020-02-05 13:07:50
问题 An import error occurs when trying to run jupyter notebook I'm trying to run jupyter notebook using anaconda ( git bash platform), and as I type in jupyter notebook, an import error occurs every time. I tried to lauch it inside an environment, but the same error occured. $ jupyter notebook Traceback (most recent call last): File "C:\Users\User\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module> from notebook.notebookapp import main File "C:\Users\User\Anaconda3\lib\site

no display name and no $DISPLAY environment variable in Jupyter Notebook

女生的网名这么多〃 提交于 2020-02-05 12:58:32
问题 I want to teach Python for kids. I want them to use Jupyter Notebook. To avoid the hassle of installation, I want them to use a free online Jupyter Notebook. I thought google's colab (link) and jupyter.org (link) could be best solutions. However, I tried them both and got the error message below: from turtle import * colors = ['red', 'purple', 'blue', 'green', 'yellow', 'orange'] for x in range(360): pencolor(colors[x % 6]) width(x / 100 + 1) forward(x) left(59) TclError: no display name and

no display name and no $DISPLAY environment variable in Jupyter Notebook

微笑、不失礼 提交于 2020-02-05 12:56:10
问题 I want to teach Python for kids. I want them to use Jupyter Notebook. To avoid the hassle of installation, I want them to use a free online Jupyter Notebook. I thought google's colab (link) and jupyter.org (link) could be best solutions. However, I tried them both and got the error message below: from turtle import * colors = ['red', 'purple', 'blue', 'green', 'yellow', 'orange'] for x in range(360): pencolor(colors[x % 6]) width(x / 100 + 1) forward(x) left(59) TclError: no display name and

Question about conditional calculation in pandas

大兔子大兔子 提交于 2020-02-05 05:14:07
问题 I have this formula, I wanted to turn this into pandas calculation, the formula is very easy: NEW = A(where v=1) + A(where v=3) + A(where v=5) I have a data frame like this: Type subType value A NEW X a 1 3 =3+9+9=21 X a 3 9 X a 5 9 X b 1 4 =4+5+0=9 X b 3 5 X b 5 0 Y a 1 1 =1+2+3=6 Y a 3 2 Y a 5 3 Y b 1 4 =4+5+2=11 Y b 3 5 Y b 5 2 Two questions: I know I can just write down the calculation with the specified cell, but I want the code looks nicer, is there other ways to get the value? Because

Can't display graphviz tree in Jupyter Notebook

本秂侑毒 提交于 2020-02-04 04:58:26
问题 I'm trying to display a decision tree in Jupyter Notebook and I keep receiving the message: CalledProcessError: Command '['dot.bat', '-Tsvg']' returned non-zero exit status 1 I'm using the following code: from sklearn.datasets import load_iris from sklearn import tree import graphviz from IPython.display import SVG iris = load_iris() clf = tree.DecisionTreeClassifier() fitted_clf = clf.fit(iris.data, iris.target) graph = graphviz.Source(tree.export_graphviz(fitted_clf, feature_names = iris

jupyter notebook keeps reconnecting

放肆的年华 提交于 2020-02-03 18:59:10
问题 I'm getting error while connecting the jupyter notebook. It says connecting to the kernel. I'm not able to execute any of the queries in that. Could anyone help me out with this. Below is the error message and logs in anaconda prompt. LOGS :: [I 16:48:48.414 NotebookApp] Adapting to protocol v5.1 for kernel 0eb0478c-3ad8-4c50-af16-31e66bf45358 [I 16:48:48.414 NotebookApp] Restoring connection for 0eb0478c-3ad8-4c50-af16-31e66bf45358:025E6CA0A7AB437F9F3FFF4C9F7A728C [I 16:48:49.269 NotebookApp

jupyter notebook keeps reconnecting

前提是你 提交于 2020-02-03 18:59:06
问题 I'm getting error while connecting the jupyter notebook. It says connecting to the kernel. I'm not able to execute any of the queries in that. Could anyone help me out with this. Below is the error message and logs in anaconda prompt. LOGS :: [I 16:48:48.414 NotebookApp] Adapting to protocol v5.1 for kernel 0eb0478c-3ad8-4c50-af16-31e66bf45358 [I 16:48:48.414 NotebookApp] Restoring connection for 0eb0478c-3ad8-4c50-af16-31e66bf45358:025E6CA0A7AB437F9F3FFF4C9F7A728C [I 16:48:49.269 NotebookApp

Running a process in the background in Jupyter

て烟熏妆下的殇ゞ 提交于 2020-02-03 16:23:31
问题 In a Jupyter notebook, if I run a cell that takes a long time, I cannot run any other cell until the first cell is computed. Is there a way to tell Jupyter to run a cell in a background process, so that I can continue to run other cells? 回答1: I tried this using Multiprocessing and found it does not work, I've no idea if this is a limitation of Windows or recent Jupyter/Python. So instead I created a solution using Threading, based on this work: https://gist.github.com/maartenbreddels

Is it possible to generate an executable (.exe) in a jupyter-notebook?

风格不统一 提交于 2020-02-03 01:55:30
问题 I wrote a code in python using jupyter notebook and i want to generate an executable of the program. 回答1: You can use this code I've written to convert large numbers of .ipynb files into .py files. srcFolder = r'input_folderpath_here' desFolder = r'output_folderpath_here' import os import nbformat from nbconvert import PythonExporter def convertNotebook(notebookPath, modulePath): with open(notebookPath) as fh: nb = nbformat.reads(fh.read(), nbformat.NO_CONVERT) exporter = PythonExporter()