jupyter-notebook

Display / Render an HTML file inside Jupyter Notebook on Google Colab platform

安稳与你 提交于 2020-05-09 20:20:50
问题 I am using Google Colab to work create maps with Python 3.0 and I have done so using Basemaps. I am next trying to create similar maps using Google Maps. There are two python packages that I have located namely gmaps and gmplot. It seems as if gmaps requires a google API but gmplot does not hence I am using gmplot. With gmplot, I am able to create a file 'my_map.html' which if I download to my local desktop, I can open in a browser and see the map correctly. However I would like to see the

How to write a cell magic that knows the input number of the cell?

这一生的挚爱 提交于 2020-05-09 17:09:42
问题 Is there a way to write a cell magic that knows the input number of the cell? By "input number" I mean the ? in the cell's In[?] prefix. At first glance, it seems that IPython.core.magic.cell_magic only knows about the cell content -- it there any way to go beyond that? 回答1: This information is provided by the execution_count of the current instance of the IPython shell, that can be obtained with get_ipython : print(get_ipython().execution_count) 来源: https://stackoverflow.com/questions

No module named 'gensim' but already installed it

你。 提交于 2020-05-09 16:57:06
问题 i'm having this error problem, i have ran this script in jupyter notebook in base (root) environment, the log said that gensim library has been installed and i have run the command !pip install gensim before i import it, but it still can not be imported, and the error said ModuleNotFoundError: No module named 'gensim' !pip install gensim import gensim from gensim.models import KeyedVectors model = KeyedVectors.load('model_fasttext2.vec') model.vector_size -------------------------------------

Is there a general way to run Web Applications on Google Colab?

我与影子孤独终老i 提交于 2020-05-08 13:50:08
问题 I would like to develop web apps in Google colab. The only issue is that you need a browser connected to local host to view the web app, but Google colab doesn't have a browser inside the notebook. But it seems that there are ways around this. For example run_with_ngrok is a library for running flaks apps in colab/jupyter notebooks https://github.com/gstaff/flask-ngrok#inside-jupyter--colab-notebooks When you use it, it gives a random address , "Running on http://.ngrok.io" And somehow the

Is there a general way to run Web Applications on Google Colab?

前提是你 提交于 2020-05-08 13:49:09
问题 I would like to develop web apps in Google colab. The only issue is that you need a browser connected to local host to view the web app, but Google colab doesn't have a browser inside the notebook. But it seems that there are ways around this. For example run_with_ngrok is a library for running flaks apps in colab/jupyter notebooks https://github.com/gstaff/flask-ngrok#inside-jupyter--colab-notebooks When you use it, it gives a random address , "Running on http://.ngrok.io" And somehow the

How to set port for pyspark jupyter notebook?

痴心易碎 提交于 2020-04-30 09:59:22
问题 I am starting a pyspark jupyter notebook with a script: #!/bin/bash ipaddres=... echo "Start notebook server at IP address $ipaddress" function snotebook () { #Spark path (based on your computer) SPARK_PATH=/home/.../software/spark-2.3.1-bin-hadoop2.7 export PYSPARK_DRIVER_PYTHON="jupyter" export PYSPARK_DRIVER_PYTHON_OPTS="notebook" # For python 3 users, you have to add the line below or you will get an error export PYSPARK_PYTHON=python3 $SPARK_PATH/bin/pyspark --master local[10] }

How to set port for pyspark jupyter notebook?

◇◆丶佛笑我妖孽 提交于 2020-04-30 09:59:19
问题 I am starting a pyspark jupyter notebook with a script: #!/bin/bash ipaddres=... echo "Start notebook server at IP address $ipaddress" function snotebook () { #Spark path (based on your computer) SPARK_PATH=/home/.../software/spark-2.3.1-bin-hadoop2.7 export PYSPARK_DRIVER_PYTHON="jupyter" export PYSPARK_DRIVER_PYTHON_OPTS="notebook" # For python 3 users, you have to add the line below or you will get an error export PYSPARK_PYTHON=python3 $SPARK_PATH/bin/pyspark --master local[10] }

Jupyter Notebook not saving: '_xsrf' argument missing from post

坚强是说给别人听的谎言 提交于 2020-04-29 05:46:17
问题 I've been running a script on jupyter notebooks for about 26 hour; I haven't really been using my computer for anything else, but it needs to run this program that will take ~30 hours to complete. At about 21 hours in, it stopped saving and my terminal had this: 403 PUT /api/contents/[file.ipynb] (::1): '_xsrf' argument missing from POST where [file.ipynb] is the location of my jupyter notebook. It also says: '_xsrf' argument missing from post in the top right part of the notebook again. The

Jupyter Notebook not saving: '_xsrf' argument missing from post

烂漫一生 提交于 2020-04-29 05:43:03
问题 I've been running a script on jupyter notebooks for about 26 hour; I haven't really been using my computer for anything else, but it needs to run this program that will take ~30 hours to complete. At about 21 hours in, it stopped saving and my terminal had this: 403 PUT /api/contents/[file.ipynb] (::1): '_xsrf' argument missing from POST where [file.ipynb] is the location of my jupyter notebook. It also says: '_xsrf' argument missing from post in the top right part of the notebook again. The

How to train and test dataset and how to convert the labels from integers to vectors in jupyter notebook?

倖福魔咒の 提交于 2020-04-18 05:29:07
问题 Here is my code partition the data into training and testing splits using 75% of the data for training and the remaining 25% for testing (trainX, testX, trainY, testY) = train_test_split(data, labels, test_size=0.25, random_state=42) convert the labels from integers to vectors trainY = to_categorical(trainY, num_classes=5) testY = to_categorical(testY, num_classes=5) And it show this type of error how to fix and solve it TypeError Traceback (most recent call last) <ipython-input-13