jupyter-notebook

Encoding error in Jupyter when %run another notebook

独自空忆成欢 提交于 2019-12-12 18:17:41
问题 I use cyrillic symbols in my Jupyter notebooks. In NoteBook №1 I run NoteBook №2. %run ./NB2.ipynb In NoteBook №2 I write in some txt file. TestText = open('C:\\TRASH\\test_text.txt', 'w') a = 'Иридий' #Iridium TestText.write(a+'\n') TestText.close() And when NB1 starts I get UnicodeDecodeError. ...can't decode byte 0x98 Full output is there: http://collabedit.com/tcev6 Briefly, Nbformat library call core.reads which, in its turn, read NB2 in win-1251 encoding. That's why first 'И' is the

Inconsistent TypeError: cannot serialize '_io.TextIOWrapper' object

徘徊边缘 提交于 2019-12-12 15:41:21
问题 I am working with Python 3.6.1 on Jupyter 5. My goal is to test how portalocker manage concurrent appending on the same file. To accomplish that I have made a simple function that appends a single line to the same file and I use multiprocessing.Pool and Pool.map() to run the function in parallel. Here is the code in Jupyter notebook. cell 1 from time import time from multiprocessing import Pool import portalocker def f(*args): while time() < start + 1: pass with open('portalocker_test.txt',

Getting Pygments to work for my cell results

给你一囗甜甜゛ 提交于 2019-12-12 15:10:07
问题 I use Jupyter Notebooks to implement and document changes that apply to our production databases. I program in Python and submit typical SQL statements to the server to fetch results and make changes. I like to print the sql as part of the cell output for verbose log of the change. I wanted pygments to help colorize the output so that the SQL would look as nice as possible. Seems that pygments uses css and I don't know how to get it included from pygments import highlight from pygments.lexers

Adding a local image to an IJulia notebook

安稳与你 提交于 2019-12-12 14:08:00
问题 How do I add a local image to an IJulia notebook? The image is in the same local network folder as the IPYNB file. The folder is accessed via a symbolic link. I've tried both relative and absolute file names. <img src="test.png" alt="Image Test" style="width:600px"> ![Image Test](test.png) Both show up the same, as a broken image link with "Image Test" next to the symbol. Jupyter Info : Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:42:40) [GCC 4.4.7 20120313 (Red Hat 4.4

Jupyter notebooks - “Permission denied” when trying to create new notebook

不想你离开。 提交于 2019-12-12 13:31:03
问题 I've been using jupyter notebooks for the past couple of months with no issue, but suddenly when launching jupyter notebook through the Command Prompt (I'm a Windows 10 user) and try to create a new python3 notebook through the browser, I suddenly receive the following error: Permission Denied Error When Creating New Python Notebook Anyone know what to do? I've tried uninstalling and reinstalling Anaconda3 . I saw another post which suggested using export XDG_RUNTIME_DIR="" but export wasn't

TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations' In Jupyter Azure

感情迁移 提交于 2019-12-12 13:18:45
问题 I am setting up my recurrent neural network in Azure: model = Sequential() model.add(GRU(units=512, return_sequences=True, input_shape=(None, x1,))) model.add(Dense(y1, activation='sigmoid')) But I am getting the error: TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations' I am not cretin but I believe I may be doing something that is now depreciated in current versions of TensorFlow & Keras, as in this example a similar error has occurred and such errors were

Jupyter Notebook: enable vertical scrolling in code block

荒凉一梦 提交于 2019-12-12 10:45:17
问题 How do I enable vertical scrolling in a code block in a jupyter notebook? I've done it accidentally before, but now I can't reproduce it. What I found was set autoscroll = true in the file itself using a text editor... However, I did that... and it already has a setting, "scrolled": true . In the notebook, it has only horizontal scrolling, so I guess that is what the "scrolled" setting modified. 回答1: In order to enable vertical scrolling in an output cell of the notebook, you just need to

OpenCV: Grayscale image displayed in greenish color [duplicate]

筅森魡賤 提交于 2019-12-12 10:34:10
问题 This question already has answers here : Show grayscale OpenCV image with matplotlib (1 answer) plt.imshow shows color images for grayscale images in IPython (1 answer) Closed last year . I am doing my first steps using OpenCV (version 3.3.0 from opencv-python package on Mac OS). Using OpenCV inside jupyter notebook and displaying a greyscale image through matplotlib results in a greenish image instead of a greyscale one. %matplotlib inline import cv2 as cv import numpy as np import

Why matplotlib is also printing data while doing a subplot?

安稳与你 提交于 2019-12-12 10:29:14
问题 Hi I can t figure out how to properly use pyplot for multiple plots, in addition to the plot it also print me the full array of data # import numpy as np import matplotlib.mlab as mlab import matplotlib.pyplot as plt mu, sigma = 100, 15 x = mu + sigma*np.random.randn(10000) fig, axes=plt.subplots(nrows=4, ncols=2) # the histogram of the data axes[1,0].hist(x, 50) # kinda work, the problem is it print the array and then do the plot plt.hist(x, 50, ax=axes[0,0]) # not wokring inner() got

Setting up Jupyter Notebook for JModelica

你。 提交于 2019-12-12 09:43:13
问题 I would like to use Jupyter Notebook for editing JModelica python scripts; however after installing, the Jupyter notebook cannot locate key libraries, such as pymodelica. Here is the process I followed to install Jupyter Notebook for JModelica Version 2.1: In the IPython terminal: !pip install jupyter In windows CMD I navigate using cd C:\JModelica.org-2.1\Python27\Scripts I then open using jupyter notebook Within the notebook I create a Python 2 file and attempt to import the pymodelica