jupyter-notebook

How to upload and save large data to Google Colaboratory from local drive?

放肆的年华 提交于 2019-12-09 12:07:42
问题 I have downloaded large image training data as zip from this Kaggle link https://www.kaggle.com/c/yelp-restaurant-photo-classification/data How do I efficiently achieve the following? Create a project folder in Google Colaboratory Upload zip file to project folder unzip the files Thanks EDIT: I tried the below code but its crashing for my large zip file. Is there a better/efficient way to do this where I can just specify the location of the file in local drive? from google.colab import files

How to use tqdm with pandas in a jupyter notebook?

允我心安 提交于 2019-12-09 08:41:36
问题 I'm doing some analysis with pandas in a jupyter notebook and since my apply function takes a long time I would like to see a progress bar. Through this post here I found the tqdm library that provides a simple progress bar for pandas operations. There is also a Jupyter integration that provides a really nice progress bar where the bar itself changes over time. However, I would like to combine the two and don't quite get how to do that. Let's just take the same example as in the documentation

How to give jupyter cell standard input in python?

天大地大妈咪最大 提交于 2019-12-09 07:38:03
问题 I am trying to run a program on a jupyter notebook that accepts user input, and I cannot figure out how to get it to read standard input. For example, if I run the code with shift-enter: a = input() print(a) the cell indicates it is running, but does not accept input from me. How do I get it to accept input? 回答1: Use the raw_input() (for Python 2) or input() (for Python 3) methods. Example code: a = raw_input() print(a) Example notebook: 回答2: I came across the same problem, using the input in

Inserting a Link to a Webpage in an IPython Notebook

核能气质少年 提交于 2019-12-09 07:23:12
问题 How is this done? I'd like to have the link be in a markdown cell. 回答1: For visual learners. [blue_text](url_here) Thanks dbliss. 回答2: In case it is not a markdown cell, that is with what I went: from IPython.core.display import display, HTML display(HTML("""<a href="https://google.at">text</a>""")) 回答3: Just another tip, using magic expression. %%html <a href="your_url_here">Showing Text</a> Improved. Thanks to the comment of calocedrus. 回答4: Here is the code I use in my python notebook when

Jupyter notebook: How to \usepackage{} for LaTeX

守給你的承諾、 提交于 2019-12-09 04:40:55
问题 I would like to know how I can \usepackage{} for LaTeX in Jupyter notebook. 回答1: Not sure this is the only or even best way of doing it, but it seems to work. Write a template file ("mytemplate.tplx") in the same directory as your ipynb notebook file ("mynotebook.ipynb"). mytemplate.tplx looks like: ((*- extends 'article.tplx' -*)) ((* block packages *)) ((( super() ))) \usepackage{amsmath} \usepackage{newtxtext,newtxmath} ((* endblock packages *)) Build your pdf LaTex file by executing the

Running an IPython/Jupyter notebook non-interactively

谁说我不能喝 提交于 2019-12-09 04:00:23
问题 Does anyone know if it is possible to run an IPython/Jupyter notebook non-interactively from the command line and have the resulting .ipynb file saved with the results of the run. If it isn't already possible, how hard would it be to implement with phantomJS, something to turn the kernel on and off, and something to turn the web server on and off? To be more specific, let's assume I already have a notebook original.ipynb and I want to rerun all cells in that notebook and save the results in a

Import OpenCV on jupyter notebook

拈花ヽ惹草 提交于 2019-12-09 03:22:31
问题 I tried installing OpenCV on Windows 10 using pip. I used this command- pip install opencv-contrib-python After that when I tried importing cv2 on command prompt, it was successfully imported- When I tried importing it on jupyter notebook, this error popped up- This is the python version I'm using- This is pip list and as I've highlighted, opencv-contrib-python version 3.4.3.18 is installed- Then why can't I import OpenCV on jupyter notebook, like tensorflow or numpy are also in pip list and

two factor authentication with username and password for a Jupyter Notebook server

自闭症网瘾萝莉.ら 提交于 2019-12-08 21:57:29
I've setup a Jupyter Notebook server with appropriate password and SSL so it is accessed via HTTPS. However, I'm looking now for a way to enforce a two factor authentication with username and password for loging in. The current Jupyter Notebook server only asks for a password and I hence have to create a shared one (no username though). I know about JupyterHub, but at the moment I'm looking for a way to add a username (or multiple usernames) and correspond password (passwords), so that everyone can access the same work space without necessarily having credentials on the Linux server side. Is

How to reuse plot in next jupyter cell [duplicate]

馋奶兔 提交于 2019-12-08 19:53:13
问题 This question already has an answer here : How do I show the same matplotlib figure several times in a single IPython notebook? (1 answer) Closed 2 years ago . I have a jupyter notebook and wish to create a plot in one cell, then write some markdown to explain it in the next, then set the limits and plot again in the next. This is my code so far: # %% %matplotlib inline import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 2 * np.pi) y = np.sin(x ** 2) plt.plot(x, y); # %%

How do I start jupyter notebook from command-line to run in my current directory, without editing config files or passing hard paths?

不羁的心 提交于 2019-12-08 18:47:49
Juypter notebook currently has a limitation: Starting terminal in current directory How do I do this from command-line (no Anaconda or other GUI), without the following unacceptable hacky approaches? (and in particular where the notebook directory might well change between invocations, or between users?) Manually edit the hard path into your jupyter notebook config file, in the c.NotebookApp.notebook_dir parameter Embed hard paths into your notebook code. Must be absolute paths. (yukky). Also user-dependent. Can't distribute notebooks which handle files properly with paths relative to their