Sistema de blogs Diarium
Universidad de Salamanca
Edgar Martín Hernández
Free Software and Chemical Engineering
 

Python

python-logo-master-v3-TM

Python

Python is an open source programming language created by Guido van Rossum in 1991. It is an interpreted high-level language, which enhances the readability of the code. This allows the user to create programs in an easier way and producing shorter codes than other programming languages. Python has a large user’s community whose provides support and creates packages, libraries and modules which extends the capabilities and applications of Python to areas such as scientific and engineering simulations, machine learning, computational chemistry, data visualization or its implementation in embedded systems, among others. It is available for the major operating systems, including Linux based OS, Windows and Mac OS.

There exists two versions of Python, Python 2.x and Python 3.x, which minor differences in their syntaxes. Python 2.x is the classical Python programming language, whereas Python 3.x provides some new features and is the current version of Python. In this chapter Python 3.6 it has been used.

IDEs

Python can be used through a text editor, such as Notepad++, Atom or Gedit, to create the script and then be executed using a terminal to run the program. However, there exist many Integrated Development Environments (IDEs) which can help in the creation of our projects. Some IDEs used for programming in Python are Spyder, PyDev, PyCharm and Geany.

Packages

The core provides the basic capabilities: data types, data structures, functions definition, control structures as conditionals sentences and loops. However, the specific functions for scientific computing are supplied by packages. The main modules used are the following:python scheme

  • NumPy: provides support to work with arrays and matrices of numeric data, linear algebra and other number capabilities.
  • SciPy: this module complements NumPy and provides algorithms for linear algebra, integration, interpolation, linear algebra and optimization, among others .
  • matplotlib: it is a 2D plotting library which, in combination with NumPy, it is capable to produce high quality figures in different formats .
  • pandas: it is package focused in data analysis and statistics
  • seaborn: it is a data visualization library based on matplotlib oriented to statistical graphics.

Nevertheless there other packages for other specific tasks, as symbolic mathematics (SymPy), visualization of 3D graphics (MayaVi), etc.

Python distributions

Both IDE’s and packages can be installed separately from Python through command lines in Python terminal. However, there are Python distributions for scientific computing which contains Python and the main modules and IDE’s, including Spyder, Jupyter, NumPy, ScyPy and Matplotlib. Some Python distributions are Anaconda, Python-XY and PyCharm. To develop this chapter Anaconda has been used (more details about Anaconda can be found in the developer website).

Política de privacidad
Studii Salmantini. Campus de excelencia internacional