jupyter-notebook

How to execute a python notebook inside another one at google cloud datalab

删除回忆录丶 提交于 2019-12-06 13:38:46
I'd like to execute a python notebook I'had created to data pre-processing inside another notebook related with data classification process. So the last notebook depends on the functions and execution provided by the first notebook. How could I do that at google cloud datalab environment? I do like to reuse the functions and variables used at the pre-processing notebook on the classification notebook. Thanks. The following should work: myNotebook = <relative path to notebook> %run $myNotebook or simply %run <relative path to notebook> Note: This does not work if you are running Datalab on

Ipython kernel error after uninstalling anaconda

前提是你 提交于 2019-12-06 13:35:25
问题 I'm on ubuntu 14.04. I was running anaconda and I used the conda command (as per this post) to make both python 2 and python 3 available in ipython notebooks. But I just uninstalled anaconda and installed ipython, jupyter and notebook individually inside a virtualenv. Now when I try to create a new notebook I get the following error. As you can see in the last line, it seems to still be referring to the kernel created with anaconda which obviously doesn't exist anymore since I uninstalled

pygal charts not displaying tooltips in Jupyter / IPython notebook

隐身守侯 提交于 2019-12-06 11:36:24
After much research, I finally managed to get tooltips working in pygal thus: Config = pygal.Config() Config.js = ['http://kozea.github.io/pygal.js/2.0.x/pygal-tooltips.js'] bar_chart = pygal.Bar(Config) # Then create a bar graph object bar_chart.add('Fibonacci', [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]) # Add some values bar_chart.render_to_file('bar_chart.svg', force_uri_protocol='https') In the produced .svg, tooltips are now working nicely, but only when the file is opened in a browser . When the chart is displayed directly in Jupyter (either with IPython.core.display.SVG(filename="bar_chart

Jupyter Lab is not using virtual environment

痴心易碎 提交于 2019-12-06 11:20:51
I created a virtual environment and installed ipython[all] and jupyter with pip. When I run jupyter lab , open a notebook, and try importing a package I installed inside the virtual environment, I get “ModuleNotFoundError.” Running ipython in the console and importing works. Also, which jupyter does point me to the right executable in the virtual environment. In addition to installing jupyter , I need to install jupyter lab . Otherwise, even the virtual environment jupyter executable actually silently falls back to the system Jupyter Lab installation. 来源: https://stackoverflow.com/questions

Is it possible to install bioconductor package 'rain' in R Jupyter notebook?

与世无争的帅哥 提交于 2019-12-06 10:41:30
I want to install the bioconductor rain package for R in Jupyter notebook. I am not able to install this package in Jupyter notebook following instructions given on the website linked above - in an R Jupiter notebook: source("https://bioconductor.org/biocLite.R") biocLite("rain") I get the following error: Warning message: In install.packages(pkgs = doing, lib = lib, ...): installation of package ‘gmp’ had non-zero exit statusWarning message: In install.packages(pkgs = doing, lib = lib, ...): installation of package ‘rain’ had non-zero exit status I was able to install a different bioconductor

Open ipython notebook on existing notebook server

不羁的心 提交于 2019-12-06 10:14:16
问题 I'm seeking a way to open ipynb file on an existing notebook server. There is a notebook server on my home directory started as follows: /home/myname$ ipython notebook And I have a notebook file /home/myname/work_dir/test.ipynb . I need a script to open this file on the notebook: cd work_dir ipynb_open test.ipynb # No such command! I know that I can open this ipynb on a new notebook server by the following command: ipython notebook test.ipynb But this command stands a new server, and I have

How to run shell script file on ipython at Google Colab

不羁岁月 提交于 2019-12-06 09:23:35
问题 I'd like to know how to run a bash sell script file on ipython(jupyter notbook) at Google Colab. I downloded an Deep-learning codes package from github and upload them on my google drive and I mount the goole drive on Google Colab The code package includes'*.py' python codes and 'fn.sh' script file. By executing the script file the python codes can be executed. I tried os.system('fn.sh') and subprocess.call('fn.sh') on the ipython prompt at Google Colab but they doesn't work like below. 1)

Run Jupyter Notebook (.ipynb) from command line as if it were a .py file

…衆ロ難τιáo~ 提交于 2019-12-06 08:54:35
问题 I am authoring a Jupyter notebook on my local machine that will eventually be run on a remote server (which is running Ubuntu). Every time I need to make a change I must export the notebook as a .py file and then call it from the command line of the server. I'd like to be able to run this on the fly, calling one command that takes the current .ipynb file and executes it on the command line as if it were a .py , showing all the print statements and output you'd expect if the .py were run. I

Messaging and Jupyter Notebooks

吃可爱长大的小学妹 提交于 2019-12-06 08:48:54
I'm trying to wrap my head around messaging in Jupyter notebooks. But I'm a bit lost and confused. My goal is fairly straight forward to state: I want my python kernel to update the output of a cell in a Jupyter notebook while a long calculation is running. Whenever new data arrives in the browser, I want to trigger a redraw by calling some javascript function. Specifically, the cell output contains HTML with a WebGL canvas. That part works well. I can easily visualize the initial data in the canvas with WebGL/javascript. But I want to update the data dynamically, as the kernel performs a long

Using Pandas DataFrame style to color a column (Python 3)

这一生的挚爱 提交于 2019-12-06 08:27:17
问题 I'm trying to follow the tutorial on http://pandas.pydata.org/pandas-docs/stable/style.html to color the background of the cells on my pandas dataframe in the color column. What is the proper way to do this using only pandas? s = """ num_markers num_contamination color 0 2.0 0.0 #db5f57 1 100.0 47.0 #db7157 2 104.0 102.0 #db8457 3 102.0 100.0 #db9657 4 NaN NaN #dba957 5 51.0 0.0 #dbbb57 6 NaN NaN #dbce57 7 92.0 63.0 #d6db57 8 NaN NaN #c4db57 9 56.0 42.0 #b1db57 """ df = pd.read_clipboard()