jupyter-notebook

IPython Notebook: how to display() multiple objects without newline

对着背影说爱祢 提交于 2020-08-01 09:44:00
问题 Currently when I use display() function in the IPython notebook I get newlines inserted between objects: >>> display('first line', 'second line') first line second line But I would like the print() function's behaviour where everything is kept on the same line, e.g.: >>> print("all on", "one line") all on one line Is there a method of changing display behaviour to do this? 回答1: No, display cannot prevent newlines, in part because there are no newlines to prevent. Each displayed object gets

Jupyter Lab and Notebook Problem: Kernel Error

我只是一个虾纸丫 提交于 2020-07-30 18:51:18
问题 It appears that somehow one of my kernels is deleted. And perhaps that's why I am getting this error. How could I possibly fix it? Can I reinstall something (the kernel in the base environment perhaps)? If no better option is available, I would try reinstalling anaconda altogether as a last resort according to: Default kernel in jupyter notebook (Python3) not working. I have tried using the following: Installation of Jupyter Lab: requirements already satisfied Kernels don't show up when

Jupyter Lab and Notebook Problem: Kernel Error

孤街浪徒 提交于 2020-07-30 18:48:14
问题 It appears that somehow one of my kernels is deleted. And perhaps that's why I am getting this error. How could I possibly fix it? Can I reinstall something (the kernel in the base environment perhaps)? If no better option is available, I would try reinstalling anaconda altogether as a last resort according to: Default kernel in jupyter notebook (Python3) not working. I have tried using the following: Installation of Jupyter Lab: requirements already satisfied Kernels don't show up when

Succint way to add line segments to plotly graph (with python/jupyter notebook)?

跟風遠走 提交于 2020-07-30 01:55:45
问题 I want to create a lollipop plot with several horizontal line segments like this - https://python-graph-gallery.com/184-lollipop-plot-with-2-group. I'd like to use plotly since I prefer the graphics (and easy interactivity) but can't find a succint way. There's both line graphs (https://plot.ly/python/line-charts/) and you can add lines in the layout (https://plot.ly/python/shapes/#vertical-and-horizontal-lines-positioned-relative-to-the-axes), but both of these solutions require each line

Succint way to add line segments to plotly graph (with python/jupyter notebook)?

你说的曾经没有我的故事 提交于 2020-07-30 01:52:45
问题 I want to create a lollipop plot with several horizontal line segments like this - https://python-graph-gallery.com/184-lollipop-plot-with-2-group. I'd like to use plotly since I prefer the graphics (and easy interactivity) but can't find a succint way. There's both line graphs (https://plot.ly/python/line-charts/) and you can add lines in the layout (https://plot.ly/python/shapes/#vertical-and-horizontal-lines-positioned-relative-to-the-axes), but both of these solutions require each line

Running Cython in Jupyter iPython

给你一囗甜甜゛ 提交于 2020-07-29 06:11:35
问题 Running an iterative loop for a geometric progression for a time trial, using the Cython interface. Get an error on compile (shift-enter): CompileError: command 'gcc' failed with exit status 1 %load_ext Cython %%cython def geo_prog_cython(double alpha, int n): cdef double current = 1.0 cdef double sum = current cdef int i for i in range(n): current = current * alpha sum = sum + current return sum The error: //anaconda/lib/python3.5/distutils/command/build_ext.py in build_extension(self, ext)

Kernel Died when running Neuralcoref

冷暖自知 提交于 2020-07-22 07:22:05
问题 I am trying to install neuralcoref and following the instructions given here. I created a jupyter notebook and try to run the following code. # Load your usual SpaCy model (one of SpaCy English models) import spacy nlp = spacy.load('en') # Add neural coref to SpaCy's pipe import neuralcoref neuralcoref.add_to_pipe(nlp) # You're done. You can now use NeuralCoref as you usually manipulate a SpaCy document annotations. doc = nlp(u'My sister has a dog. She loves him.') doc._.has_coref doc._.coref

Anaconda Jupyter Notebooks Kernel Problems

我的未来我决定 提交于 2020-07-21 10:23:41
问题 TL,DR: How can I make my machine/anaconda forget that python 3.7 exists so that I can run everything on python 3.6? I've put the full story in a list format to make this easier to read. 1) I have a working BagOfWords in Python 2.7. It was running just fine with Jupyter Notebooks. 2) I wanted to use a python library called Newspaper, but it works best in python 3 instead of python 2. 3) I download python 3.7 so Newspaper can run. 4) Newspaper works great with Python 3.7, but another module,

Jupyter OSError 0x7e when loading rpy2

耗尽温柔 提交于 2020-07-21 04:12:19
问题 I'm on windows 10, I have a freshly installed Anaconda Python 3.7 64 bit and I'd like to run my jupiter notebook on my D: drive for reasons. Then I open my jupyter command, and place myself in D: before launching jupyter notebook. When I want to load rpy2 I'm facing this issue : %load_ext rpy2.ipython --------------------------------------------------------------------------- OSError Traceback (most recent call last) <ipython-input-52-fb23c6edefe4> in <module> ----> 1 get_ipython().run_line

Can a jupyter notebook find its own filename?

▼魔方 西西 提交于 2020-07-20 07:33:29
问题 Is it possible for a jupyter notebook to get the name of its own file, similarly to what we would do from a python script? os.path.basename(__file__) doesn't seem to work, at least for me on jupyterlab sys.argv[0] returns my_home/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py 回答1: The only way I've found is through JavaScritp as in this answer. The compact form is a cell like this: %%javascript IPython.notebook.kernel.execute(`notebookName = '${window.document.getElementById(