(about_py)=

# About Python

> \"Python has gotten sufficiently weapons grade that we don't descend
> into R anymore. Sorry, R people. I used to be one of you but we no
> longer descend into R.\" -- Chris Wiggins


## What\'s Python?

[Python](https://www.python.org) is a general-purpose programming
language conceived in 1989 by Dutch programmer [Guido van
Rossum](https://en.wikipedia.org/wiki/Guido_van_Rossum).

Python is free and open source, with development coordinated through the
[Python Software Foundation](https://www.python.org/psf/).

Python has experienced rapid adoption in the last decade and is now one
of the most commonly used programming languages.

Popular textbooks on Python programming include {cite}`guttag2016introduction` and {cite}`hill2016learning`.

### Common Uses

Python is a general-purpose language used in almost all application domains
such as

-   communications
-   web development
-   CGI and graphical user interfaces
-   game development
-   multimedia, data processing, security, etc., etc., etc.

Python is beginner-friendly and routinely used to teach computer science and
programming in top computer science programs.

Python is particularly popular within the scientific and data science
communities.

It is steadily [replacing familiar tools like
Excel](https://news.efinancialcareers.com/us-en/3002556/python-replaced-excel-banking)
in the fields of finance and banking.

### Relative Popularity

The following chart, produced using Stack Overflow Trends, shows one
measure of the relative popularity of Python

```{figure} /_static/lecture_specific/about_py/python_vs_matlab.png
:scale: 72%
```

The figure indicates not only that Python is widely used but also that
adoption of Python has accelerated significantly since 2012.

This is driven at least in part by uptake in the scientific
domain, particularly in rapidly growing fields like data science.

For example, the popularity of [pandas](http://pandas.pydata.org/), a
library for data analysis with Python has exploded, as seen here.

(The corresponding time path for MATLAB is shown for comparison)

```{figure} /_static/lecture_specific/about_py/pandas_vs_matlab.png
:scale: 23%
```

Note that pandas takes off in 2012, which is the same year that we see
Python\'s popularity begin to spike in the first figure.

Overall, it\'s clear that

-   Python is [one of the most popular programming languages worldwide](http://spectrum.ieee.org/computing/software/the-2017-top-programming-languages).
-   Python is a major tool for scientific computing, accounting for a
    rapidly rising share of scientific work around the globe.

### Features

Python is a [high-level language](https://en.wikipedia.org/wiki/High-level_programming_language)
suitable for rapid development.

It has a relatively small core language supported by many libraries.

Multiple programming styles are supported (procedural, object-oriented, functional, etc.)

Python is interpreted rather than compiled.

### Syntax and Design

One nice feature of Python is its elegant syntax --- we\'ll see many
examples later on.

Elegant code might sound superfluous but in fact it\'s highly beneficial
because it makes the syntax easy to read and easy to remember.

Remembering how to read from files, sort dictionaries and other such
routine tasks means that you don\'t need to break your flow in order to
hunt down correct syntax.

Closely related to elegant syntax is an elegant design.

Features like iterators, generators, decorators and list comprehensions
make Python highly expressive, allowing you to get more done with less
code.

[Namespaces](https://en.wikipedia.org/wiki/Namespace) improve
productivity by cutting down on bugs and syntax errors.

## Scientific Programming

Python has become one of the core languages of scientific computing.

It\'s either the dominant player or a major player in

-   [machine learning and data science](http://scikit-learn.org/stable/)
-   [astronomy](http://www.astropy.org/)
-   [artificial intelligence](https://wiki.python.org/moin/PythonForArtificialIntelligence)
-   [chemistry](http://chemlab.github.io/chemlab/)
-   [computational biology](http://biopython.org/wiki/Main_Page)
-   [meteorology](https://pypi.org/project/meteorology/)

Its popularity in economics is also beginning to rise.

## Bibliography

```{bibliography} ../_bibliography/references.bib
```