FastML

Machine learning made easy

Why IPy: reasons for using IPython interactively

IPython is known for the notebooks. But the first thing they list on their homepage is a “powerful interactive shell”. And that’s true - if you use Python interactively, you’ll dig IPython.

Here are a few features that make a difference for us:

  • command line history and autocomplete
    These are basic shell features you come to expect and rely upon after a first contact with a Unix shell. The standard Python interpreter feels somewhat impoverished without them.

  • %paste
    Normally when you paste indented code, it won’t work. You can fix it with this magic command.

  • other %magic commands
    Actually, you can skip the %: paste, run some_script.py, pwd, cd some_dir

  • shell commands with !
    For example !ls -las. Alas, aliases from your system shell don’t work.

  • looks good
    Red and green add a nice touch, especially in a window with dark background.

If you have a light background, use %colors LightBG

Share your favourite features in the comments. For more, see Using IPython for interactive work.

Talk about the article with a chatbot (Llama 3.3 70B from together.ai). The chatbot is rate-limited to six requests per minute. The messages are stored on your device.
basics, software

« How to get predictions from Pylearn2 Yesterday a kaggler, today a Kaggle master: a wrap-up of the cats and dogs competition »

Comments