According to a PriceWaterhouseCoopers report, 74% of top Australian CEO’s “say availability of key skills – including technology skills – is a threat” to their business. One way to address this shortage of skills is for companies to train their staff in STEM (Science Technology Engineering and Mathematics) skills. The same report estimates that moving just 1 percent of the workforce to STEM roles would add $57.4 billion to Australia’s gross domestic product.
So how can we train staff in STEM skills? A practical way is to equip them with powerful IT tools that lead to innovation. Most of us are aware of Python as a computer language, but are we aware of the awesome power it has for STEM applications?
Here are 10 powerful STEM abilities that Python unlocks
1. Write code that is both powerful and easy to read
Python is designed to be a general-purpose programming language that is easy to write and understand. In Python the same algorithm can be expressed in far fewer lines of code than other languages such as C++. Fewer lines of code means less time is spent in software development and fewer chances for errors to creep in. During execution of a Python program, the Python interpreter is careful at error and sanity checking, and when programming errors do occur, Python is very helpful in pointing out where the errors are.
Careful sanity checking can slow Python performance when compared to other languages like C. However, when developer time is more important than execution time – such as in exploratory data analysis, prototyping ideas, and testing hypotheses – the productivity benefits of writing simple and powerful code far outweigh potential drawbacks.
2. Write code that is platform-independent
When a Python script runs it is compiled to a platform-independent language called bytecode. Bytecode instructions are then translated into machine instructions by a program called a Python Virtual Machine. With this design the same Python code can run on multiple platforms such as Windows, MacOS and Linux, and across multiple architectures such as ARM, x86 or PowerPC. You can, for example, develop a Python program on Windows and run it on a Linux machine. Platform-independent code is also great for cloud computing where compute resources and software environments are frequently subject to change.
3. Join complex systems
Python speaks a wide range of protocols and data formats. You can for example, use Python to access databases using SQL, and send and receive data over the network using libraries like socket, MPI4PY, and ZeroMQ. Python can read and write binary and ASCII files and has support for data formats like HDF5. Python can run programs both locally and over remote connections using SSH. The flexibility that Python provides makes it ideal for joining complex systems.
4. Do sophisticated math with powerful science libraries
Thanks to the Numpy and Scipy packages, Python has first rate multidimensional arrays with a comprehensive set of linear algebra routines. These linear algebra routines call optimized low-level math routines for performance. The low-level routines are interchangeable, this means you can use highly optimised commercial libraries like Intel’s MKL.
In addition to having great array support, Scipy and Numpy support a range of capabilities like statistics and random number generation; interpolation and numerical integration; N-dimensional Fast Fourier Transforms; optimisation, image processing, and special functions like Bessel functions. You can even use Einstein notation for math with tensors!
5. Export publication-quality plots
With the Matplotlib package, Python supports almost limitless versatility in making and arranging beautiful 2D and 3D figures and exporting them to images. The plotting backends support a wide variety of image formats, including popular ones such as SVG, PDF, EPS, TIFF, PNG. The majority of plots in my supernova research paper were made with Python. Plotting packages like Bokeh and Plotly provide 2D and 3D plots that are rendered by a web browser. Both Bokeh and Plotly give you the tools to make beautiful dashboards.
6. Provision cloud resources
The big three cloud providers Amazon, Google, and Microsoft all have software development kits that allow you to provision and maintain cloud computing resources from within Python programs. This is great because you can easily integrate cloud provisioning into Python workflows.
7. Explore machine learning and artificial intelligence algorithms
Python provides an easy on-ramp to machine learning and classification algorithms with the well-documented Tensor Flow, Theano, and Scikit-learn libraries. This is useful, for example, in image and speech recognition, clustering data, creating artificial neural networks, and data mining.
8. Get more from your data with analytics and big data capabilities
The Pandas package provides an interface for reading and writing Microsoft Excel spreadsheets and powerful tools for working with labelled and time-series data. Data analytics and business intelligence benefits enormously from Pandas, as it provides easy lookup and transformation of data. The big data processing framework Apache Spark has a Python interface so you can run distributed algorithms over large scale clusters.
9. Conduct reproducible research
Jupyter notebooks have the ability to store HTML content, equations, and code in one file for easy sharing with colleagues and collaborators. This is great because readers can execute the code in the notebook and reproduce the results of the author, thus saving time. Python works great with Jupyter; 2D and 3D visualisations can be incorporated directly into notebooks.
10. Get it for free
The best reason is that Python is free and open source. The intellection property rights are held by the Python Software Foundation, which releases the software under a GPL-compatible open source license. This means you are free to distribute and use Python to an unlimited number of machines.
Python and its associated libraries bring a wide variety of capabilities that make it a powerful tool for STEM. In 2008 I started using Python for all my data processing needs and it has benefitted my research enormously. I am sure it can do the same for you.