jupyter-notebook

Pyspark error: Java gateway process exited before sending its port number

牧云@^-^@ 提交于 2019-12-10 02:56:09
问题 I am using Pyspark to run some commands in Jupyter Notebook but it is throwing error. I tried solutions provided in this link (Pyspark: Exception: Java gateway process exited before sending the driver its port number) and I tried doing the solution provided here (such as Changing the path to C:Java, Uninstalling Java SDK 10 and reinstalling Java 8, still it is throwing me the same error. I tried uninstalling and reinstalling pyspark, and I tried running from anaconda prompt as well still I am

Changing jupyter's matching parenthesis color

半城伤御伤魂 提交于 2019-12-09 19:44:14
问题 How do I change the color of the matching parentheses in jupyter? Regular, square, and curly brackets all appear in bright green when they are shown as matching pairs and it is pretty difficult to see in light background. Modifying ~/.jupyter/custom/custom.css by adding .CodeMirror-matchingbracket doesn't seem to do anything for me. 回答1: In ~/.jupyter/custom/custom.css try adding the following: .cm-s-ipython .CodeMirror-matchingbracket { color: black !important;} If you don't want the color

Jupyter has 0 active kernels (Anaconda with Python 2.7)

本小妞迷上赌 提交于 2019-12-09 19:31:05
问题 I've installed Anaconda 2.5 w/Python 2.7. Upon launching jupyter (which is bundled in Anaconda), the python kernel isn't being detected. The web server launches and listens on 8888. The browser notebook editor works fine. However, I can't run any python code. The "Cell" menu isn't appearing. Is there a configuration file or something that needs to be installed? Here's the output from the console: [I 21:32:27.625 NotebookApp] Serving notebooks from local directory: C:\Users\smilesydney [I 21

Unable to read csv file uploaded on google cloud storage bucket

两盒软妹~` 提交于 2019-12-09 18:41:24
问题 Goal - To read csv file uploaded on google cloud storage bucket. Environment - Run Jupyter notebook using SSH instance on Master node. Using python on Jupyter notebook trying to access a simple csv file uploaded onto google cloud storage bucket. Approaches - 1st approach - Write a simple python program Wrote following program import csv f = open('gs://python_test_hm/train.csv' , 'rb' ) csv_f = csv.reader(f) for row in csv_f print row Results - Error message "No such file or directory" 2nd

Trouble with Jupyter certifications

与世无争的帅哥 提交于 2019-12-09 17:41:12
问题 I've been having trouble connecting to a Jupyter notebook instance on AWS. This is a little out of my wheelhouse, so any help would be appreciated! ubuntu@ip-172-31-20-132:~$ export XDG_RUNTIME_DIR="" ubuntu@ip-172-31-20-132:~$ jupyter notebook [I 22:04:19.553 NotebookApp] JupyterLab extension loaded from /home/ubuntu/anaconda3/lib/python3.7/site-packages/jupyterlab [I 22:04:19.553 NotebookApp] JupyterLab application directory is /home/ubuntu/anaconda3/share/jupyter/lab [I 22:04:19.557

choose python kernel in jupyter

本秂侑毒 提交于 2019-12-09 17:34:56
问题 I have installed on Debian Jessie: Python2.7 Python3.5 I have also installed Jupyter via pip2 and pip3 However when I launch jupyter-notebook I can only use python3 as kernel! How can I switch to pyhton2.7 when using Jupyter? 回答1: I tried this with a fresh Debian 8.5 machine on Digital Ocean. As root, install pip and jupyter from apt, and the development packages, too. apt-get install python-pip python-dev python3-pip python3-dev libzmq3 pip3 install jupyter Add the kernel for Python2 using

Wrapping column names in Python Pandas DataFrame or Jupyter Notebooks

本秂侑毒 提交于 2019-12-09 16:49:54
问题 I have long titles for some of my columns in my data frame, and I would like the ability to wrap the text. I know that this functionality is built into pandas, as I do: pd.DataFrame(np.random.randn(2, 10), columns=['Very Long Column Title ' + str(i) for i in range(10)]) DataFrame with wrapped column names But if I have fewer columns, the titles will not wrap: pd.DataFrame(np.random.randn(10, 2), columns=['Very Long Column Title ' + str(i) for i in range(2)]) DataFrame does not wrap column

Increment matplotlib color cycle

女生的网名这么多〃 提交于 2019-12-09 15:55:34
问题 Is there a simple way to increment the matplotlib color cycle without digging into axes internals? When plotting interactively a common pattern I use is: import matplotlib.pyplot as plt plt.figure() plt.plot(x,y1) plt.twinx() plt.plot(x,y2) The plt.twinx() in necessary to get different y-scales for y1 and y2 but both plots are drawn with the first color in the default colorcycle making it necessary to manually declare the color for each plot. There must be a shorthand way to instruct the

How to run a Python script in a '.py' file from a Google Colab notebook?

自古美人都是妖i 提交于 2019-12-09 15:34:31
问题 %%javascript IPython.OutputArea.prototype._should_scroll = function(lines) { return false; } %run rl_base.py I run this giving error saying rl_base.py file not found. I have uploaded the same to gdrive in colab and from the same folder I am running my .ipynb file, containing the above code 回答1: If you have the test.py file in the corresponding folder in drive as in the below attached image, then the command which you use to run the test.py file is as mentioned below, !python gdrive/My\ Drive

Jupyter Notebook time profiling

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-09 15:25:24
问题 So I installed jupyter notebook through anaconda and I am working on python 3 kernel. I am trying to do Time profiling using %time magic command as show here The problem is that it only prints the Wall Time not the CPU Time using %time or %%time does not help %time prints the wall time for the first line only %%time prints the wall time for the whole cell I am not sure if there any specif config to print the CPU time EDIT To clarify using %%time should print two metrics for the whole cell