jupyter-notebook

Setting up Jupyter Notebook for JModelica

妖精的绣舞 提交于 2019-12-05 13:13:59
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 library, which is followed by: ImportError Traceback (most recent call last) in () ----> 1 import

Jupyter Notebook: How to copy paste image into MS word?

不打扰是莪最后的温柔 提交于 2019-12-05 13:06:05
I tried to copy the image and paste them into MS word, but it didn't work. I'm not sure if this is my problem, or the word's problem? The images are at: https://cdn.rawgit.com/cqcn1991/Wind-Speed-Analysis/master/output_HTML/marham.html#5.3-Sectoral-Comaprison The paste result (in MS Word), it's done by CTRL+C, CTRL+V: I can only paste the text, not the image. I experiment it with Medium and another web app. Medium works exactly like MS Word, while another is able to paste. I think the underlying problem may be that the image in Jupyter Notebook is too deep in divs? so it get escaped in Word?

Using Pylint in Ipython (Jupyter-Notebook)

狂风中的少年 提交于 2019-12-05 12:58:56
问题 I want to run Pylint or any equivalent while using Jupyter-Notebook. Is there a way to install and run Pylint this way? 回答1: pycodestyle is an equivalent of pylint for Jupyter Notebook which is able to check your code against the PEP8 style guide. First, you need to install the pycodestyle in jupyter notebook by typing this command, !pip install pycodestyle pycodestyle_magic Run this command in a cell of jupyter notebook. After successful installation, you have to load the magic in a Jupyter

Plotly gives an empty field as output in jupyter lab

試著忘記壹切 提交于 2019-12-05 12:44:18
I'm using plotly at jupyter lab, but I'm getting a blanked output. I'm having exactly the same problem described here: plotly.offline.iplot gives a large blank field as its output - why? And I tried what they suggested in the answers, but it didn't work. Here is the code I'm using: import pandas as pd import numpy as np %matplotlib inline from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot init_notebook_mode(connected=True) cf.go_offline() df = pd.DataFrame(np.random.randn(100,4), columns='A B C D'.split()) df2 = pd.DataFrame({'category':['A','B','C'], 'values':[32,43

Expected tensorflow model size from learned variables

流过昼夜 提交于 2019-12-05 11:56:57
When training convolutional neural networks for image classification tasks we generally want our algorithm to learn the filters (and biases) that transform a given image to its correct label. I have a few models I'm trying to compare in terms of model size, number of operations, accuracy, etc. However, the size of the model outputed from tensorflow, concretely the model.ckpt.data file that stores the values of all the variables in the graph, is not the one I expected. In fact, it seems to be three times bigger. To go straight to the problem I'm gonna base my question on this Jupyter notebook.

Bokeh: pass vars to CustomJS for Widgets

倖福魔咒の 提交于 2019-12-05 11:43:34
A nice thing about Bokeh is that callbacks can be specified from the Python layer that result actions on the javascript level without the need of bokeh-server. So one can create interactive widgets that run in a browser without an Ipython or Bokeh server running. The 0.9.3. documentation gives an example that I can reproduce in an ipython notebook: http://docs.bokeh.org/en/latest/docs/user_guide/interaction.html#cutomjs-for-widgets from bokeh.io import vform from bokeh.models import CustomJS, ColumnDataSource, Slider from bokeh.plotting import figure, output_file, show output_file("callback

How to place custom Jupyter kernels inside virtual environment?

别等时光非礼了梦想. 提交于 2019-12-05 10:32:26
I have a custom Jupyter kernel which runs IPython using a custom IPython profile which uses a matplotlib stylesheet. I know to run this successfully normally I would put: The matplotlib stylesheet in ~/.config/matplotlib/stylelib/ The IPython profile in ~/.ipython/ The kernel json in ~/.jupyter/kernels/my_kernel/ But I am doing this as part of larger program which runs in a virtualenv, and if I put the things as above then any notebook server running on the computer will be able to see the custom kernels, even if it is running outside the venv. I don't what this because I don't want my program

How to specify python3 kernel in jupyter in pyCharm?

☆樱花仙子☆ 提交于 2019-12-05 10:00:47
Here is my setting and this is my script I am trying to use jupyter notebook in pyCharm, but it kept using python2 instead of python3. Any idea about this problem? Add: this pic is running jupyter notebook in chrome. My problem was that I had multiple kernels, and PyCharm launches the default kernel. One approach might be to configure PyCharm to specify the kernel of choice to start up, I didn't investigate how to do that. I simply changed the default kernel in Jupyter and this worked for me (I have a virtualenv for tensorflow). c.MultiKernelManager.default_kernel_name = 'tensorflow' . The

How to suppress matplotlib inline for a single cell in Jupyter Notebooks/Lab?

狂风中的少年 提交于 2019-12-05 09:43:48
I was looking at matplotlib python inline on/off and this kind of solves the problem but when I do plt.ion() all of the Figures pop up (100s of figures). I want to keep them suppressed in a single cell. Is there a with loop I can use to turn off %matplotlib inline or is this impossible? 来源: https://stackoverflow.com/questions/49545003/how-to-suppress-matplotlib-inline-for-a-single-cell-in-jupyter-notebooks-lab

Pyspark - converting json string to DataFrame

痴心易碎 提交于 2019-12-05 09:40:12
I have a test2.json file that contains simple json: { "Name": "something", "Url": "https://stackoverflow.com", "Author": "jangcy", "BlogEntries": 100, "Caller": "jangcy"} I have uploaded my file to blob storage and I create a DataFrame from it: df = spark.read.json("/example/data/test2.json") then I can see it without any problems: df.show() +------+-----------+------+---------+--------------------+ |Author|BlogEntries|Caller| Name| Url| +------+-----------+------+---------+--------------------+ |jangcy| 100|jangcy|something|https://stackover...| +------+-----------+------+---------+----------