Python:Advanced Predictive Analytics
上QQ阅读APP看书,第一时间看更新

IDEs for Python

The IDE or the Integrated Development Environment is a software that provides the source-code editor cum debugger for the purpose of writing code. Using these software, one can write, test, and debug a code snippet before adding the snippet in the production version of the code.

IDLE: IDLE is the default Integrated Development Environment for Python that comes with the default implementation of Python. It comes with the following features:

  • Multi-window text-editor with auto-completion, smart-indent, syntax, and keyword highlighting
  • Python shell with syntax highlighting

IDLE is widely popular as an IDE for beginners; it is simple to use and works well for simple tasks. Some of the issues with IDLE are bad output reporting, absence of line numbering options, and so on. As a result, advanced practitioners move on to better IDEs.

IPython Notebook: IPython Notebook is a powerful computational environment where code, execution, results, and media can co-exist in one single document. There are two components of this computing environment:

  • IPython Notebook: Web applications containing code, executions, plots, and results are stored in different cells; they can be saved and edited as and when required
  • Notebook: It is a plain text document meant to record and distribute the result of a computational analysis

The IPython documents are stored with an extension .ipynb in the directory where it is installed on the computer.

Some of the features of IPython Notebook are as follows:

  • Inline figure rendering of the matplotlib plots that can be saved in multiple formats(JPEG, PNG).
  • Standard Python syntax in the notebook can be saved as a Python script.
  • The notebooks can be saved as HTML files and .ipynb files. These notebooks can be viewed in browsers and this has been developed as a popular tool for illustrated blogging in Python. A notebook in IPython looks as shown in the following screenshot:

    An Ipython Notebook

Spyder: Spyder is a powerful scientific computing and development environment for Python. It has the following features:

  • Advanced editing, auto-completion, debugging, and interactive testing
  • Python kernel and code editor with line numbering in the same screen
  • Preinstalled scientific packages like NumPy, pandas, scikit-learn, matplotlib, and so on.
  • In some ways, Spyder is very similar to RStudio environment where text editing and interactive testing go hand in hand:

    The interface of Spyder IDE

In this book, IPython Notebook and Spyder have been used extensively. IDLE has been used from time to time and some people use other environments, such as Pycharm. Readers of this book are free to use such editors if they are more comfortable with them. However, they should make sure that all the required packages are working fine in those environments.