jupyter-notebook

Show code line numbers in JupyterLab

纵饮孤独 提交于 2020-08-22 04:01:20
问题 In Jupyter notebook, cntrl + m L toggles code line numbers in current cell but how to bring the code line numbers in JupyterLab? Referred a similar issue opened in github 回答1: https://github.com/jupyterlab/jupyterlab/issues/2395 - shift-L toggles line number visibility. 回答2: you can turn this on by default by going into Settings --> Advanced Settings Editor: As you can see from the screenshot, you can edit other features as well and easily set them back to default by deleting your 'User

Matplotlib plot from Python script not showing up in output when run in Jupyter Notebook

北城余情 提交于 2020-08-19 09:06:20
问题 Trying to run a Python script from the directory that my Jupyter notebook is in. The script executes as expected, but the plot does not show up in the output in my Jupyter Notebook. I have tried adding code like plt.show() to the test script, but it doesn't show the graph in the Jupyter output. I have also tried adding %matplotlib inline to the Jupyter cell, but that doesn't help either. In Jupyter Notebook cell: import matplotlib as plt %matplotlib inline !python test_plot.py In the test

Installing find spark in virtual environment

*爱你&永不变心* 提交于 2020-08-11 18:47:07
问题 I am using pyenv to create a virtual environment. My pyenv packages are located under the project bio in /.pyenv/versions/bio/lib/python3.7/site-packages I installed findspark using below pip install findspark #it was installed successfully. I am able to see the below files in the packages directory. findspark-1.4.2.dist-info findspark.py However, when I launch Jupyter notebook from the pyenv directory, I get an error message import findspark findspark.init() ImportError: No module named

Installing find spark in virtual environment

ぃ、小莉子 提交于 2020-08-11 18:45:59
问题 I am using pyenv to create a virtual environment. My pyenv packages are located under the project bio in /.pyenv/versions/bio/lib/python3.7/site-packages I installed findspark using below pip install findspark #it was installed successfully. I am able to see the below files in the packages directory. findspark-1.4.2.dist-info findspark.py However, when I launch Jupyter notebook from the pyenv directory, I get an error message import findspark findspark.init() ImportError: No module named

Installing find spark in virtual environment

六眼飞鱼酱① 提交于 2020-08-11 18:45:09
问题 I am using pyenv to create a virtual environment. My pyenv packages are located under the project bio in /.pyenv/versions/bio/lib/python3.7/site-packages I installed findspark using below pip install findspark #it was installed successfully. I am able to see the below files in the packages directory. findspark-1.4.2.dist-info findspark.py However, when I launch Jupyter notebook from the pyenv directory, I get an error message import findspark findspark.init() ImportError: No module named

JupyterLab sys.argv[1] is '-f'

本秂侑毒 提交于 2020-08-10 18:55:19
问题 I'm trying to write a program on JupyterLab (Ipython) which takes Command Line arguments as its input. #! python3 # pw.py - An insecure password locker program. PASSWORDS = {'email': 'F7minlBDDuvMJuxESSKHFhTxFtjVB6', 'blog': 'VmALvQyKAxiVH5G8v01if1MLZF3sdt', 'luggage': '12345'} import sys,pyperclip if len(sys.argv) < 2: print('Usage: python pw.py [account] - copy account password') sys.exit() account = sys.argv[1] # first command line arg is the account name if account in PASSWORDS: pyperclip

Notebooks: Passing string variables as arguments to python script via command line(!), using quotes And $, eg -arg1 '$varible1'

两盒软妹~` 提交于 2020-08-10 05:35:12
问题 In using variables in the command line from a notebook cell, I saw that we can use put a $ in front of the variable, or surround the variable using {} , for example !command {variable} or !command $variable But when I was running a python script using the command line from a notebook cell, I would get errors variable1 = '/path/to/directory' variable2 = 7 !Script.py -arg1 $variable1 -arg2 $variable2 and !Script.py -arg1 {variable1} -arg2 {variable2} did not work. After experimenting a little

Getting a Jupyter notebook to listen to input events while running a continuous process?

十年热恋 提交于 2020-08-09 09:13:09
问题 I'm trying to do something in a Jupyter notebook that runs a continuous process, but with a pause button to interrupt it. Below is a simplified version of what I've done so far, but it seems Ipython wants to complete the entire run() function before it executes commands it receives from the button. The problem, of course, being that run() will never finish unless interrupted. Interestingly, the below strategy works just fine in my Tkinter frontend so long as I put a pause(0.0001) at the end

how to load data to jupyter notebook VM from google cloud?

送分小仙女□ 提交于 2020-08-08 18:51:40
问题 I am trying to load a bunch of csv files stored on my google cloud into my jupyter notebook. I use python 3 and gsutil does not work. Lets's assume I have 6 .csv files in '\bucket1\1'. does anybody know what I should do? 回答1: You are running a Jupyter Notebook on a Google Cloud VM instance. And you want to load 6 .csv files (that you currently have on your Cloud Storage) into it. Install the dependencies: pip install google-cloud-storage pip install pandas Run the following script on your

how to load data to jupyter notebook VM from google cloud?

社会主义新天地 提交于 2020-08-08 18:46:41
问题 I am trying to load a bunch of csv files stored on my google cloud into my jupyter notebook. I use python 3 and gsutil does not work. Lets's assume I have 6 .csv files in '\bucket1\1'. does anybody know what I should do? 回答1: You are running a Jupyter Notebook on a Google Cloud VM instance. And you want to load 6 .csv files (that you currently have on your Cloud Storage) into it. Install the dependencies: pip install google-cloud-storage pip install pandas Run the following script on your