About Python

This introduction to Python 3 is mainly based on the excellent Python resources provided by Thomas J. Sargent and John Stachurski.

What’s Python?

Python is a general-purpose programming language conceived in 1989 by Dutch programmer Guido van Rossum.

Python is free and open source, with development coordinated through the Python Software Foundation.

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 [Guttag, 2016] and [Hill, 2016].

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 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

../_images/python_vs_matlab.png

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, a library for data analysis with Python has exploded, as seen here.

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

../_images/pandas_vs_matlab.png

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

Features

Python is a high-level 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 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

Its popularity in economics is also beginning to rise.

Bibliography

Gut16

John Guttag. Introduction to computation and programming using Python: With application to understanding data. MIT Press, 2016.

Hil16

Christian Hill. Learning scientific programming with python. Cambridge University Press, 2016.

WH00

Rüdiger Wirth and Jochen Hipp. CRISP-DM: Towards a standard process model for data mining. In Proceedings of the 4th international conference on the practical applications of knowledge discovery and data mining, volume 1. Springer-Verlag London, UK, 2000.