Skip to content
Advertisement

Tag: ipython

IPython, “name ‘plt’ not defined”

I recently installed Atom as an IDE on my laptop, for university. I installed Hydrogen as a convenient solution to show some plots on the go. But whenever I run Hydrogen, I get this error: However Matplotlib is working properly when executed normally, and IPython seems to do as well. This is the code I’m trying to run test-wise: A

Argparse in iPython notebook: unrecognized arguments: -f

I am trying to pass a .py file to ipython notebook environment. I have never had to deal directly with argparse before. How do I rewrite the main() function? I tried to delete the line of def main(): and keep the rest of the code. But args = parser.parse_args()” returned an error: ipykernel_launcher.py: error: unrecognized arguments: -f. And when I

How to store the result from %%timeit cell magic?

I can’t figure out how to store the result from cell magic – %%timeit? I’ve read: Can you capture the output of ipython’s magic methods? Capture the result of an IPython magic function and in this questions answers only about line magic. In line mode (%) this works: But in cell mode (%%) it does not: It simply executes the

Jupyter: disable restart kernel warning

I’m using jupyter 4.1.0, and I find myself making frequent use of the “Restart & Run All” feature. Every time I use that button it displays this warning: Is there a way to disable that warning? Answer You can add a cell in your notebook and using the following statements: And the kernel will restart immediately.

Advertisement