Getting started

Back to main page

Stuff to install

You will need Python (obviously), NumPy, SciPy, Matplotlib, and pandas. Here are links to the respective pages for the installers and/or instructions to download the libraries:

  • Python: Windows and Mac users download the installer from the website. Users of *nix OSes typically install Python through their package manager.
  • NumPy. NumPy is a library that adds multi-dimensional array support, various mathematical functions, and datatypes. It is also largely responsible for allowing vectorization of data in many Python applications and libraries.
  • SciPy. SciPy is a library that adds most basic numerical methods algorithms that scientists typically use.
  • Matplotlib. Matplotlib is a library aimed at visualization.
  • pandas. Pandas is a basic library for data manipulation and analysis. It is sometimes criticized for poor inefficiencies, but is generally an okay starting point.

Pages to bookmark

How do I do X?

Google it.

Hello, world!

Almost every programmer’s introduction to programming is getting the computer to print “Hello, World!” to a console. These pages are no exception. We achieve this in Python via the following code:

print('Hello, world!')

To actually run the thing, the user will save the above code block into a file such as helloworld.py and run it with the appropriate command. On Windows, that command is

py helloworld.py

and on just about every other operating system, the command is

python helloworld.py

Python shell

It is also possible to run Python code without having to create a new file every time. One way of achieving this is to run code in the Python shell. To open the Python shell in Windows, type

py

into a terminal. On just about every other operating system, type

python

into a terminal.

Exercises

  1. Write a Python program to print your own name.

  2. Using the Python terminal, compute \(5 + 6.5\).

Back to main page