jupyter-notebook

use tkinter for nltk draw inside of jupyter notebook

a 夏天 提交于 2019-12-13 02:55:51
问题 I'm trying to draw graph ( inline ) of nltk inside of jupyter-notebook . But got error: TclError: no display name and no $DISPLAY environment variable I have tried to set $DISPLAY to different values: $env DISPLAY=0.0 # or $env DISPLAY=inline # or $env DISPLAY= but got error (or similar): TclError: couldn't connect to display "0.0" here is my code https://github.com/hyzhak/nltk-experiments/blob/master/main.ipynb the last cell. Environment: official anaconda3 docker -- continuumio/anaconda3:4

How to make matplotlibs nbagg backend generate SVGs?

爱⌒轻易说出口 提交于 2019-12-13 02:37:40
问题 Currently, I'm using the following at the start of my notebook to generate SVG plots: %matplotlib inline %config InlineBackend.figure_format = 'svg' When using the nbagg backend instead (like this: %matplotlib nbagg ), plots are generated as PNGs. Is it possible to configure the nbagg backend to generate SVGs? 回答1: The Agg backend in matplotlib uses the Anti-Grain Geometry 2D graphics library to generate bitmap graphics. The documentation for the backend states: Output to RGBA and PNG,

Launching Spyder and JupyterNotebook causes importError when image not found

独自空忆成欢 提交于 2019-12-13 02:24:55
问题 I'm new to python and the virtual environment stuff. I'm facing issues opening jupyter notebook and Spyder after updating conda. Here are some info about the versions I have: $ conda info active environment : None '''is it caused by this ? ''' user config file : /Users/-/.condarc populated config files : /Users/-/.condarc conda version : 4.5.4 conda-build version : 3.0.27 python version : 2.7.14.final.0 base environment : /Users/-/anaconda2 (writable) channel URLs : https://repo.anaconda.com

Black background behind a figure's labels and ticks, only after saving figure but not in Python Interactive view (VS Code with Jupyter functionality)?

北城余情 提交于 2019-12-13 01:47:00
问题 I have a strange problem where if I save a figure, its labels and ticks will have a black background, see this example: plt.savefig("asdsadsad.png") I'm not even including any code here because this happens on the simplest plotting, even with code that I made earlier with a different computer that never had this problem. I'm using VS Code with Jupyter functionality and the figures look normal in the Python Interactive view , but have the black border when saved . Any ideas what could cause

How to change the font in Markdown cells when they are in Edit Mode?

拈花ヽ惹草 提交于 2019-12-13 00:54:35
问题 I want to change the font type in Markdown cells when I am editing them. How Can I do that? I can edit the file .jupyter/custom/custom.css and change the font when they are "run": div.text_cell_render { font-family: 'Linux Libertine O'; font-size: 12pt; } As shown in the figure, the upper half is a Markdown cell in edit mode, and that is the place where I want to change the font. 回答1: A simple possibility is from IPython.display import HTML, display display(HTML('<style>.CodeMirror{font

pandas_datareader not working in jupyter-notebook (Anaconda)

若如初见. 提交于 2019-12-12 22:11:24
问题 ModuleNotFoundError Traceback (most recent call last) in () 3 from matplotlib import style 4 import pandas as pd ----> 5 import pandas_datareader.data as web 6 7 style.use('ggplot') ModuleNotFoundError: No module named 'pandas_datareader' 回答1: data reader gotta be installed separetly. if using anacoda, try: conda install -c https://conda.anaconda.org/anaconda pandas-datareader 来源: https://stackoverflow.com/questions/46257905/pandas-datareader-not-working-in-jupyter-notebook-anaconda

Understanding namespace when using Javascript from Ipython.core.display in Jupyter Notebook

拥有回忆 提交于 2019-12-12 20:28:16
问题 I am having trouble understanding the namespace of the Javascript function that is provided in IPython. from IPython.core.display import display, Javascript display(Javascript(u""" var variable = 'Hello' console.log(variable) """)) [output] Hello The above seems to work fine, but the following throws an error. display(Javascript(u""" var variable = 'Hello' """)) display(Javascript(u""" console.log(variable) """)) [output] Javascript error adding output! ReferenceError: variable is not defined

Jupyter Notebook cell output cut off/truncated by margin caused by Jupyter Themes

允我心安 提交于 2019-12-12 20:24:44
问题 My cell output in Jupyter Notebook is cut off on the left hand side which obscures the leftmost output. For reference (I can't post images yet): https://imgur.com/gallery/rg759nN Any idea how to fix this? EDIT: Thanks to rabbit on below, the problem seems to be caused by using the alternate themes provided by Jupyter Themes 回答1: Found the solution on Jupyter Themes github page: https://github.com/dunovank/jupyter-themes/issues/288 "In the custom.css file, I fixed it by changing both the div

Loading local data google colab

久未见 提交于 2019-12-12 19:37:45
问题 I have a npy file, (largeFIle.npy) saved in the same "colab notebooks" folder on my google drive that I have my google colab notebook saved in. I'm trying to load the data into my notebook with the code below but I'm getting the error below. This code works fine when I run it locally on my laptop with the notebook in the same folder as the file. Is there something different I need to do when loading data with notebooks in google colab? I'm very new to colab. code: dataset_name = 'largeFIle

creating subplots in python plotly

我们两清 提交于 2019-12-12 19:13:56
问题 I am fairly new to python and ploty (<3 months of actual coding at this point). I am trying to create subplots in plotly. I have created graphs in plotly using the code below(code snippets attached below as well), but I can't seem to get them to work using subplots I create many of these types of data graphs and any help in tightening my code would be much appreciated. Here is a sample dataset (below is the only way I know how to line it up on this site??) [NOTE: it is not the exact same