Packages/Modules

The power of Python comes form thousands of modules which are shipped with python or can be installed via python's package manager. A package contains usually many modules. The standard package manager of python is called “pip” which downloads the package for you and installs it. This is not just very convenient but also is safe because the download location is the official python repository.

In general you import modules with the “import” command. For example “import numpy as np” imports the module numpy into python and abbreviates it as “np” so that you'd write “np.sin(c)” to call the sine function in numpy.

The import command loads essentially a file called “numpy.py” so that you can write your own modules just by creating file with that name. See below in the “class” section for an example. There are numerous ways how to import modules but the “import as” way is by far the most popular.

Important modules are:

github / contact

Creative Commons License