jupyter

python/sage: how to get the last expression?

python/sage: how to get the last expression? Question: If I do in Jupiter (in both python and sage) something like: a = 42 b = 43 a + b it will, somehow, manage to understand that this process returns the value a + b, i.e. 85 here: Similarly, if I just do: a = 42 …

Total answers: 2

Minimum package requirements to run a jupyter notebook in vscode

Minimum package requirements to run a jupyter notebook in vscode Question: Recently I keep running into problems with my python notebooks in vscode where vscode doesn’t see the installed ipykernel. There are several posts on this issue with suggestions to update certain packages (VSCode not picking up ipykernel, Python requires ipykernel to be installed, vscode …

Total answers: 3

my ipywidgets work in jupyter notebook, but not in html file after exporting

my ipywidgets work in jupyter notebook, but not in html file after exporting Question: i can press a button and get it to trigger events within the notebook, but when i export a html file, they no longer work. import ipywidgets as widgets from IPython.display import HTML from ipywidgets import interactive from ipywidgets import interact …

Total answers: 1

Import "numpy" could not be resolved; ipynb in vscode

Import "numpy" could not be resolved; ipynb in vscode Question: Im in trouble with using umpy module in ipynb(jupyter notebook) file in vscode, it doesn’t work only in ipynb file. If I make new .py file and import modules, no error comes out. Could anybody tell me why this happens? Asked By: COTHE || Source …

Total answers: 1

Jupyter Notebook cells not showing in code-server running in a docker

Jupyter Notebook cells not showing in code-server running in a docker Question: I want to use Jupyter notebooks in Code-Server in a docker. For whatever reasons I cant get it running and I also have/found no error messages that could help me finding the cause. Jupyter notebook files (ipynb) can be created and I can …

Total answers: 1

How to access Python variables notebook from python script

How to access Python variables notebook from python script Question: How to access Python variables (for example a Pandas dataframe in a Jupyterlab notebook) from a python script ? I need to access a Dataframe (while I’m working in a notebook) from a python script, locally. I need to access it without having to type …

Total answers: 1

Get value and type of python variable similar to Jupyter behavior

Get value and type of python variable similar to Jupyter behavior Question: Assume you have a Jupyter notebook with one entry that has three lines: x = 1 y = x + 1 y The output will print ‘2’ I want to do this inside my python code. If I have a variable lines and …

Total answers: 1

Jupyter Notebooks incorrectly calculating numpy conjugation to a power

Jupyter Notebooks incorrectly calculating numpy conjugation to a power Question: I happened upon some error in my Jupyter Notebook that I can’t explain. I have the following code. import numpy as np c = 100 c_conj = np.conjugate(c) print(c == c_conj) print(c**5 == c_conj**5) Resulting in the output True False I get the same result …

Total answers: 1

Python doesn't know the class attributes, while Jupyter does

Python doesn't know the class attributes, while Jupyter does Question: I have this code from StatQuest channel. This code works in Jupyter, however when I run this in a .py file, it reports the error AttributeError: ‘BasicNNTrain’ object has no attribute ‘w00’ This is the code: import torch import torch.nn as nn import torch.nn.functional as …

Total answers: 1