jupyter-notebook

Is there a shortcut for selecting current word when editing a cell in jupyter notebook?

旧街凉风 提交于 2021-01-28 13:39:36
问题 The bounty expires in 6 days . Answers to this question are eligible for a +50 reputation bounty. Wolfram Arnold wants to draw more attention to this question: The bounty goes to the person who provides an answer of a functional keyboard shortcut on Win/Mac/Linux. I know there is the shortcut ctrl + w in visual studio for selecting current word. Is there a shortcut or an extension for jupyter notebook which does the same? 回答1: Hah! I found the answer shortly after putting a bounty out. On

How to access python variables in Sagemaker Jupyter Notebook shell command

廉价感情. 提交于 2021-01-28 13:32:43
问题 In one of the cells of Sagemaker notebook, I've set a variable region="us-west-2" In subsequent cell, I run following 2 shell commands !echo $region Output us-west-2 However, unable to run aws shell command using this variable !aws ecr get-login-password --region $region $ variable-name doesn't help inside jupyter cell ! shell command 回答1: As answered here: https://stackoverflow.com/a/19674648/5157515 There's no direct way to access python variables with ! command. But with magic command %

How to access python variables in Sagemaker Jupyter Notebook shell command

非 Y 不嫁゛ 提交于 2021-01-28 13:31:33
问题 In one of the cells of Sagemaker notebook, I've set a variable region="us-west-2" In subsequent cell, I run following 2 shell commands !echo $region Output us-west-2 However, unable to run aws shell command using this variable !aws ecr get-login-password --region $region $ variable-name doesn't help inside jupyter cell ! shell command 回答1: As answered here: https://stackoverflow.com/a/19674648/5157515 There's no direct way to access python variables with ! command. But with magic command %

How to create a Single Vector having 2 Dimensions?

不羁的心 提交于 2021-01-28 12:09:28
问题 I have used the Equation of Motion (Newtons Law) for a simple spring and mass scenario incorporating it into the given 2nd ODE equation y" + (k/m)x = 0; y(0) = 3; y'(0) = 0. I have then been able to run a code that calculates and compares the Exact Solution with the Runge-Kutta Method Solution. It works fine...however, I have recently been asked not to separate my values of 'x' and 'v', but use a single vector 'x' that has two dimensions ( i.e. 'x' and 'v' can be handled by x(1) and x(2) ).

Why do I get this error when installing Jupyter notebook?

北战南征 提交于 2021-01-28 10:19:18
问题 ERROR: Command errored out with exit status 1: command: 'c:\users\nithi\appdata\local\programs\python\python39\python.exe' 'c:\users\nithi\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\nithi\AppData\Local\Temp\tmpba_qtkcq' cwd: C:\Users\nithi\AppData\Local\Temp\pip-install-dq1r1ff8\argon2-cffi Complete output (25 lines): running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.9

Why do I get this error when installing Jupyter notebook?

自闭症网瘾萝莉.ら 提交于 2021-01-28 10:06:04
问题 ERROR: Command errored out with exit status 1: command: 'c:\users\nithi\appdata\local\programs\python\python39\python.exe' 'c:\users\nithi\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\nithi\AppData\Local\Temp\tmpba_qtkcq' cwd: C:\Users\nithi\AppData\Local\Temp\pip-install-dq1r1ff8\argon2-cffi Complete output (25 lines): running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.9

Cython using gmp arithmetic

夙愿已清 提交于 2021-01-28 09:15:27
问题 I'm trying to implement a simple code in cython using Jupyter notebook (I use python 2) and using gmp arithmetic in order to handle very large integers. I'm not a gmp/cython expert. My question is : how do I print the value a in the function fib(). The following code returns {}. As fas as I can understand it has to do with stdout. For instance I tried gmp_printf and it didn't work. %%cython --link-args=-lgmp cdef extern from "gmp.h": ctypedef struct mpz_t: pass cdef void mpz_init(mpz_t) cdef

Calculating and adding average and standard deviation columns to a data frame

六眼飞鱼酱① 提交于 2021-01-28 09:13:12
问题 I have: df = pd.DataFrame({'A1': [0.1,0.5,3.0, 9.0], 'A2':[2.0,4.5,1.2,9.0]}) I would like to add 2 columns to the data frame that calculate the average and standard deviation like: A1 A2 Mean Stddev 0 0.1 2.0 0 0 1 0.5 4.5 0 0 2 3.0 1.2 0 0 3 9.0 9.0 0 0 回答1: Let's try with assign using mean and std with parameter axis=1 : df.assign(Mean=df.mean(1), Stddev=df.std(1)) Output: A1 A2 Mean Stddev 0 0.1 2.0 1.05 1.343503 1 0.5 4.5 2.50 2.828427 2 3.0 1.2 2.10 1.272792 3 9.0 9.0 9.00 0.000000 Edit

Matplotlib plotting some characters as blank square

不打扰是莪最后的温柔 提交于 2021-01-28 08:22:15
问题 I'm working on reading some photos and taking the text with OCR. Now I need to rank the text read into some graph in order to see some pattern. But when I try to plot those texts into a graph, I got blank squares in the place of some characters. I'm sharing a example of what I've done with a script: This is an example script: import numpy as np import matplotlib.pyplot as plt fig, ax = plt.subplots() y = [0,1,2,3] group_labels = ['77 7 7 7\r\nlfISldI\r\n\r\n', 'G217\r\nini\r\n\r\n', 'L519\r

How can I ask jupyter to automatically revert when file has changed on disk

夙愿已清 提交于 2021-01-28 08:07:46
问题 Hello I am using jupyter-lab with the jupytext extension. This extension allows you to --sync different format so that you can edit say a Rmd file that will automatically be converted to ipynb This ipynb file is loaded in jupyter To update the file opened in jupyter I have to click on "save", I then get the following message I then have to click on revert to update from disk. Is there a way so that the file on disk is automatically "reloaded" each time it changed or say every second and that