jupyter-notebook

Write out file with google colab

我是研究僧i 提交于 2019-12-21 09:18:14
问题 Was there a way to write out files with google colab? For example, if I use import requests r = requests.get(url) Where will those files be stored? Can they be found? And similarly, can I get the file I outputted via say tensorflow save function saver=tf.Saver(....) ... path = saver.save(sess, "./my_model.ckpt") Thanks! 回答1: In your first example, the data is still in r.content . So you also need to save them first with open('data.dat', 'wb').write(r.content) Then you can download them with

How can I display the version of my Jupyter notebook and run cells in Jupyter notebooks? I get an error: bad interpreter

与世无争的帅哥 提交于 2019-12-21 09:13:29
问题 I have installed Anaconda and I use the conda environments and the conda command to install software. When I type: jupyter notebook --version I get the following error: zsh: /Users/cr517/.local/bin/jupyter: bad interpreter: /Users/cr517/anaconda/envs/snakes/bin/python: no such file or directory 5.2.1 I can open a jupyter notebook by typing: jupyter notebook xyz.ipynb but I cannot run any cells. The cell is marked with * after I run it. Soon, this message appears in a pop-up box: The kernel

How to Use a Jupyter Notebook in Visual Studio 2017?

僤鯓⒐⒋嵵緔 提交于 2019-12-21 07:52:57
问题 Visual Studio 2017 now supports use of a Jupyter Notebook. A Lap Around Python in Visual Studio 2017 According to the MSDN blog post: To work with a notebook, simply download your IPYNB file as a .py file and open it in Visual Studio. You’ll see that markdown cells have been turned into comments and each cell is collapsible and expandable. When I download a IPYNB file, rename to a .py file, it displays in the VS editor as a JSON file containing markdown. I was expecting to see a markdown file

How to Use a Jupyter Notebook in Visual Studio 2017?

混江龙づ霸主 提交于 2019-12-21 07:51:11
问题 Visual Studio 2017 now supports use of a Jupyter Notebook. A Lap Around Python in Visual Studio 2017 According to the MSDN blog post: To work with a notebook, simply download your IPYNB file as a .py file and open it in Visual Studio. You’ll see that markdown cells have been turned into comments and each cell is collapsible and expandable. When I download a IPYNB file, rename to a .py file, it displays in the VS editor as a JSON file containing markdown. I was expecting to see a markdown file

Atom/Sublime like Multiple selections in Jupyter

隐身守侯 提交于 2019-12-21 07:39:09
问题 How can I select matching keywords in a Jupyter notebook via a keyboard shortcut? For example, in the Atom/Sublime editor I can hit cmd + D on a mac (or Ctrl + d on Windows) while the cursor is over 'var' and each time I do that the next 'var' will be highlighted. I can then type the new variable name and 'var' is replaced with whatever I typed. var = "hello" print(var) print(var) Is there an equivalent in a Jupyter notebook? 回答1: Add custom.js to C:\Users\username\.jupyter\custom # for

Atom/Sublime like Multiple selections in Jupyter

前提是你 提交于 2019-12-21 07:38:50
问题 How can I select matching keywords in a Jupyter notebook via a keyboard shortcut? For example, in the Atom/Sublime editor I can hit cmd + D on a mac (or Ctrl + d on Windows) while the cursor is over 'var' and each time I do that the next 'var' will be highlighted. I can then type the new variable name and 'var' is replaced with whatever I typed. var = "hello" print(var) print(var) Is there an equivalent in a Jupyter notebook? 回答1: Add custom.js to C:\Users\username\.jupyter\custom # for

Jupyter magic to handle notebook exceptions

淺唱寂寞╮ 提交于 2019-12-21 07:02:49
问题 I have a few long-running experiments in my Jupyter Notebooks. Because I don't know when they will finish, I add an email function to the last cell of the notebook, so I automatically get an email, when the notebook is done. But when there is a random exception in one of the cells, the whole notebook stops executing and I never get any email. So I'm wondering if there is some magic function that could execute a function in case of an exception / kernel stop. Like def handle_exception

Highlight part of the code in a Jupyter cell

蓝咒 提交于 2019-12-21 06:58:21
问题 Is there a way to highlight certain lines of a Jupyter cell? Something similar to the following image (I created that with a photo editor): I don't mean a selection with the cursor, but something permanent. This would be useful for presentations when you want to highlight newly added code for example. 回答1: The Jupyter notebook extension provided below allows you to highlight ranges of lines in a code cell. Install and enable it as follows: $ jupyter nbextension install codehighlighter.js -

Disable warnings in jupyter notebook

六眼飞鱼酱① 提交于 2019-12-21 04:18:00
问题 I'm getting this warning in jupyter notebook. /anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:10: DeprecationWarning: object of type <class 'float'> cannot be safely interpreted as an integer. # Remove the CWD from sys.path while we load stuff. /anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:11: DeprecationWarning: object of type <class 'float'> cannot be safely interpreted as an integer. # This is added back by InteractiveShellApp.init_path() It's annoying because

Importing custom module into jupyter notebook

耗尽温柔 提交于 2019-12-21 04:10:51
问题 Yes, I know this is a recurrent question but I still couldn't find a convincing answer. I even read at https://chrisyeh96.github.io/2017/08/08/definitive-guide-python-imports.html but could not find out how to solve the problem: I'm running python 3.6 project that includes jupyter (ipython) notebooks. I want the notebook to import a custom local helpers.py package that I will probably use also later in other sources. The project structure is similar to: my_project/ │ ├── my_project/ │ ├──