ipython

convert jupyter notebook saved as .HTML file back into .IPYNB

convert jupyter notebook saved as .HTML file back into .IPYNB Question: Can I convert a Jupyter Notebook saved as .HTML file back into .IPYNB file? The executable original notebooks were lost. The nbconvert docs don’t have anything useful for this case. Currently I have to copy-paste bunch of cells into a new notebook, but this …

Total answers: 1

IPython %timeit what is loop and iteration in the options?

IPython %timeit what is loop and iteration in the options? Question: I am wondering about the %timeit command in IPython From the docs: %timeit [-n<N> -r<R> [-t|-c] -q -p<P> -o] setup_code Options: -n: execute the given statement times in a loop. If this value is not given, a fitting value is chosen. -r: repeat the …

Total answers: 3

ImportError: No module named IPython

ImportError: No module named IPython Question: When i try to use from IPython.display import clear_output, display_html, then i show the error: (ImportError: No module named IPython) I am using Python 2.7.13, and im trying to make the game of life from John Conway. I am following this link: http://nbviewer.jupyter.org/url/norvig.com/ipython/Life.ipynb I have read another questions and …

Total answers: 9

Selection with .loc in python

Selection with .loc in python Question: I saw this code in someone’s iPython notebook, and I’m very confused as to how this code works. As far as I understood, pd.loc[] is used as a location based indexer where the format is: df.loc[index,column_name] However, in this case, the first index seems to be a series of …

Total answers: 5

Password protect a SPECIFIC Jupyter notebook

Password protect a SPECIFIC Jupyter notebook Question: The docs describe how to create a password to protect your jupyter notebooks. I would like to be able to create and share a particular notebook with a special password for just that notebook. Is this possible? Asked By: abalter || Source Answers: No, it is not possible. …

Total answers: 2

What is the best way to convert a pdf file into base64Binary?

What is the best way to convert a pdf file into base64Binary? Question: Using python, I want to convert a pdf file into base64Binary My logic(not python) is reading the contents of the file into a byte array and then use something like Convert.ToBase64String() method to get the Base64 string: byte[] pdfBytes = File.ReadAllBytes(pdfPath); string …

Total answers: 2

Why does !! in Python run commands but encase the output in brackets

Why does !! in Python run commands but encase the output in brackets Question: A typeo produced an unexpected result and just in case it has a use, I want to understand it. !!C:/myPythonPath/python script/event.py Single ! runs a command (DOS, LINUX, other commands you could normally execute from a command line) from within Python, …

Total answers: 2

SystemExit: 2 error when calling parse_args() within ipython

SystemExit: 2 error when calling parse_args() within ipython Question: I’m learning basics of Python and got already stuck at the beginning of argparse tutorial. I’m getting the following error: import argparse parser = argparse.ArgumentParser() args = parser.parse_args() usage: __main__.py [-h] echo __main__.py: error: unrecognized arguments: -f An exception has occurred, use %tb to see the …

Total answers: 8

How to show object's objects like in ipython

How to show object's objects like in ipython Question: In ipython I can use TAB to view an object’s objects: In [1]: import numpy as np In [2]: np. Display all 590 possibilities? (y or n) np.ALLOW_THREADS np.bartlett np.errstate np.isclose np.nested_iters np.seterrcall np.BUFSIZE np.base_repr np.euler_gamma np.iscomplex np.newaxis np.seterrobj np.CLIP np.bench np.exp np.iscomplexobj np.newbuffer np.setxor1d np.ComplexWarning …

Total answers: 2

How can I configure IPython to issue the same "magic" commands at every startup?

How can I configure IPython to issue the same "magic" commands at every startup? Question: I’d like to be able to use %cd “default_dir” and %matplotlib whenever I call ipython from my terminal. I tried writing this in a .py file in .ipython/profile_default/startup/file.py but it results in the following error: [TerminalIPythonApp] WARNING | Unknown error …

Total answers: 2