Hi! Please take a moment to think about this question:
How is Python applied in real-world scenarios?
If you are learning Python and you want to know the answer, then this article is for you.
Having a clear idea of the applications and vast potential of this programming language will give you the motivation that you will need throughout your journey.
Let's begin! ✨
Python is used in virtually every industry and scientific field that you can imagine, including:
This article covers a wide range of applications of this programming language in these industries with examples, use cases, and Python libraries. Let's start with the applications of Python in data science.
Perhaps one of the most popular applications of Python is data science. The power of the Python libraries developed for data analysis and visualization is amazing. Let's see why.
With a Python data visualization library, you can create a wide variety of plots and visual representations, such as:
You can add text, labels, annotations, color, shapes, collections, animations, and interactivity to your plots depending on the package or library that you choose to work with.
💡 Tip: You can see some examples of data visualizations generated with Python in the image above.
Let's see some of the most popular packages and libraries to work with Python in data science:
If you want to learn data analysis and visualization using Python, Jupyter Notebooks, Numpy, Pandas, CSV files, data frames, and more, you can start your journey with freeCodeCamp's free Data Analysis with Python Certification:Screenshot of the certification in freeCodeCamp's curriculum.
During the certification, you work on and complete these projects:
freeCodeCamp's YouTube channel also has these great free tutorials to get you started:
In addition, these are helpful resources if you want to learn how to work with these libraries:
Python is an essential tool for every developer who wants to enter the fascinating area of Machine Learning. Let's see a brief introduction to Machine Learning.
Machine Learning is an area of Computer Science that creates systems that are able to learn on their own.
This type of system uses algorithms that are continuously improved based on input data that helps the system "learn". It learns how to respond autonomously to new scenarios by generating an appropriate output in new scenarios based on previous knowledge.
One of the most amazing things about these systems is that they are continually refined.
They are not like the programs that we typically write in a Python script where we specify every possible action that the program can take. In Machine Learning, the system is trained to "think" and make decisions based on previous knowledge.
This is why we say that machines "learn" from the data.
💡 Tip: This is an interesting talk by Google: Machine Learning Zero to Hero (Google I/O'19) .
Neural networks are the processing units of the system. They try to simulate a real network of neurons of the brain. These virtual "neurons" receive input, learn how to process that input, and generate an output based on their previous knowledge.
This is very similar to what out brain does every single moment of every single day.
Thanks to neural networks, a Machine Learning algorithm can learn how to predict the expected output from a given input based on previous knowledge.
For example, when you see recommended videos on YouTube, those recommendations were generated by neural networks that predict what videos you might like to watch based on your previous patterns. Amazing, right?
💡 Tip: This is an interesting article by Google if you would like to read more about this YouTube example.
I'm sure you must be asking: what is the role of Python in this area? It is one of the most popular and powerful tools used to program this type of system.
One of the most popular libraries used by developers around the world to work with Python applied to Machine Learning is TensorFlow. It's a free open-source library developed by the Google Brain Team. This library is used for research and production at Google.
According to Jeff Dean, the lead of Google's Artificial Intelligence division:Today it is used heavily in our speech recognition systems, in a new Google Photos product, Gmail, and Google Search. ( source )
The best part is that developers all over the world can use this library to tackle real-world problems.
💡 Tip: This is a great video about TensorFlow made by Google.
These are two other popular Python libraries used for Machine Learning:
The potential of Machine Learning is really endless. It can be applied to virtually any area and context that you can think of. If the task requires learning from patterns and predicting output, then a Machine Learning model can definitely help.
For example, to give you an idea of the type of projects that you can create, freeCodeCamp's curriculum includes a free Machine Learning with Python Certification:Certification in freeCodeCamp's curriculum
During the certification, you work on and complete these projects:
You can find more examples of the applications of Machine Learning in Kaggle , an "online community of data scientists and machine learning practitioners" owned by Google.
In this platform, you can practice your Python and Machine Learning skills by working on projects and participating in competitions.
To give you an idea of the type of projects that you can tackle with Machine Learning, previous competitions in Kaggle include:
As you can see, just in this short list of projects, the applications range from medicine to business, from biology to risk detection, and from fraud detection to image processing. The possibilities are truly endless when you tackle real-world problems using Machine Learning.
freeCodeCamp's YouTube channel has these helpful tutorials to get you started with Machine Learning in Python:
Python is used in the field of web development to build the back-end of web applications. Let's start this section by talking a little bit about what the back-end is and how it helps us to create web applications.
In a web application, all the code used to interact with the user and create what the user sees is called the front-end part of the application.
Python is used to code the behind-the-scenes functionality of the application, the part that powers all the functionality of the application but that you don't see directly on screen.
It handles the server-side of the application, interacting with all the necessary databases when the user requests data. It returns the requested data to the user to make the application run as expected.
💡 Tip: Full-Stack Web Development involves both the front-end and back-end of a web application to make it presentable to the user while working with databases.
These are some popular Python web frameworks:
freeCodeCamp's YouTube channel has great free tutorials to learn web development in Python:
These are also great free resources to learn how to work with these frameworks:
Python currently plays a key role in computer science education around the world. Let's see why.
Python is so widely used as a teaching tool because:
The creator of the Python language, Guido van Rossum , stated that:Now, it's my belief that Python is a lot easier than to teach to students programming and teach them C or C++ or Java at the same time because all the details of the languages are so much harder.
Python's syntax is simple and straightforward, so students can start learning computational thinking and problem-solving skills much more quickly, which is usually the main goal of introductory computer science courses.
Many universities and schools around the world have decided to teach introductory programming and computer science courses using Python.
For example, MIT, one of the world's leading universities in the field of technology, teaches introductory computer science and programming using Python (both in the on-campus and online versions of the course on edX).
According to an article by MIT News published when the online version of the course reached 1.2 million enrollments, the course "has become the most popular MOOC in MIT history".
This clearly shows that Python's popularity continues to rise. In the article you can find testimonies of students who learned Python and how this new knowledge improved their lives.
In the article, Professor Ana Bell, lecturer in the EECS Department at MIT, states that:“At its core, the 6.00 series teaches computational thinking...It does this using the Python programming language, but the course also teaches programming concepts that can be applied in any other programming language.”
This clearly shows the potential of Python as a teaching tool. It can be used to teach higher level concepts that can be applied to other programming languages.
And it does this without the extra layer of complexity that the syntax of other programming languages like Java or C might add to the learning process.
During the last few years, online courses have become an important part of the daily lives of learners of all ages worldwide. The variety of free online courses and resources has expanded tremendously in the last few years.
For example, freeCodeCamp's curriculum includes three free certificates with projects to help you expand your Python skills in key areas with high demand worldwide:
Harvard University also offers these online courses that can be audited for free:
Python has definitely become a key tool that has improved computer science education worldwide. And it will continue to do so in the future.
If you are thinking about teaching a course using Python or learning Python, I guarantee you that your time and effort will be totally worth it.
Python is used for computer vision and image processing, fields that are expanding rapidly.
The goal of image processing is to process an image, apply transformations to it, and return a new version of the original image.
In contrast, the goal of computer vision is more complex because it tries to make the computer understand and interpret an image and its content.
Let's start with image processing. With a Python library, you can perform operations such as:
Now let's dive into computer vision. If you start researching this topic, you might be surprised by its current applications. Some of them are:
This scientific field is so important that Google developed a tool called Cloud Vision , which has a Python version for developers to incorporate this functionality into their programs.
According to the " Using the Vision API with Python " tutorial in Google Codelabs, the Google Cloud Vision API:Allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content.
This set of tools provides functionality for face detection, landmark detection, logo detection, label detection, text detection, and more.
💡 Tip: One of the most amazing applications of computer vision is the development of software to control self-driving cars. These vehicles need to "see" where they are driving, where the lane is, and what objects surround them (including other vehicles). Computer vision plays a key role in this functionality.
These are some awesome libraries for computer vision and image processing:
Games definitely shape lives and create timeless memories. They will continue to be part of our society in the years to come. Python is already there, lighting the spark of game creation.
According to the official Python Documentation , there are two main Python frameworks used to develop games:
You can also use the turtle module to create simple games. Turtle is a built-in Python module that is installed automatically when you install Python in your computer. It helps you to create games with simple graphics and with a simple user interface.
If you want learn game development in Python, freeCodeCamp's YouTube channel has these great free tutorials:
Python also has amazing applications in the medical field. You will be surprised by how technology is being combined with medical knowledge to provide accurate and efficient diagnoses and treatments to patients.
Some examples of the use of Python in medicine and pharmacology include:
These broad applications include thousands and thousands of examples around the world. I selected a few of them to illustrate how Python is shaping this field. Let's take a look at them.
According to the official Python Documentation , one of the world's leading pharmaceutical companies, AstraZeneca , used Python to improve their existing computational models to make them "more robust, extensible, and maintainable".
Researchers used these models simulate the chemical structure of molecules and their effect in the body. This helped scientists identify potential molecules for new drugs and start testing them more quickly in the laboratory.
When he joined the team, Andrew Dalke, being a a "well-known advocate for Python in computational chemistry and biology" convinced the team that Python was exactly what they needed.Python was chosen for this work because it is one of the best languages available for physical scientists, that is, for people who do not have a computer science background.
He stated that:Python was designed to solve real-world problems faced by an expert programmer. The result is a language that scales well from small scripts written by a chemist to large packages written by a software developer.
Amazing, right? Python can power the computational models that pharmaceutical laboratories use to develop new drugs.
Another interesting medical application of Python is related to Hematology. Usually, specialized professionals analyze blood tests by counting and identifying cells manually, but this can be improved with the help of automation.
Researchers found that Python can be the right tool for the job. Let's see an interesting project.
IdentiCyte The goal of this project is to identify and classify red blood cells shapes based on images taken from optical microscopes. According to this article , "RBC shape can help to diagnose diseases and disorders such as leukaemia, sickle cell anaemia and malaria."
The project was developed by researchers from the Bioresource Processing Research Institute Australia. It was programmed in Python and it used image processing Python packages and libraries such as numpy, scipy, opencv-python, scikit-learn, and matplotlib.
Python also has amazing applications in the world of Biology and Bioinformatics. These include processing DNA sequences, simulating population dynamics and genetics, and modeling biochemical structures.
Biopython is a Python framework with "freely available tools for biological computation". Its goal is to "address the needs of current and future work in bioinformatics."
According to its documentation , this framework includes functionality such as the ability to:
The documentation states that "the goal of Biopython is to make it as easy as possible to use Python for bioinformatics by creating high-quality, reusable modules and classes."
Rosalind is "a platform for learning bioinformatics through problem solving." It is "free and open to the public" (the FAQ page indicates that it is in beta mode).
Python can be used to solve the challenges on the platform. Since this is a very popular programming language in the platform, there is a " Python Village " section where you can learn the basics of Python before tackling bioinformatics algorithms.
Users solve the problems by running their solutions on their computer, processing the given dataset, and copy/pasting the output to check the answer.
💡 Tip: The project's name commemorates Rosalind Franklin , "whose X-ray crystallography with Raymond Gosling facilitated the discovery of the DNA double helix by Watson and Crick".
💡 Tip: If you would like to learn more about the applications of Python in Bioinformatics, here's a talk by Martin Schweitzer at PyCon Australia: " Python for Bioinformatics for learning Python ".
Python also has applications in neuroscience and experimental psychology research.
According to the article Python in neuroscience written by researchers from the Center for Brain Simulation, Ecole Polytechnique Fédérale de Lausanne, Geneva, Switzerland:Computation is becoming essential across all sciences, for data acquisition and analysis, automation, and hypothesis testing via modeling and simulation.
In regards to Python, they state that:It became clear to us in 2007 that we were on the cusp of an emerging Python in neuroscience ecosystem, particularly in computational neuroscience and neuroimaging, but also in electrophysiological data analysis and in psychophysics.
As you can see, Python and computation have been expanding across all sciences.
PsychoPy is "an open-source package for running experiments in Python" supported by the University of Nottingham. According to the official Documentation of this package:It is used by many labs worldwide for psychophysics, cognitive neuroscience and experimental psychology.
The official website of this package states that it is:
Python also has applications in Astronomy and Astrophysics. Let's see three of the main Python packages used in this scientific area:
The Astropy package "contains various classes, utilities, and a packaging framework intended to provide commonly-used astronomy tools."
Astropy is part of a larger project called The Astropy Project, which is "is a community effort to develop a common core package for Astronomy in Python and foster an ecosystem of interoperable astronomy packages."
According to its About page, one of its goals is to "improve usability, interoperability, and collaboration between astronomy Python packages."
💡 Tip: You can see examples of projects made with Astropy in the Example Gallery .
The SunPy package is described as "the community-developed, free and open-source solar data analysis environment for Python." It builds upon the capabilities of Python packages such as NumPy, SciPy, Matplotlib, and Pandas.Images from the Example Gallery of SunPy
The SpacePy package is "a package for Python, targeted at the space sciences, that aims to make basic data analysis, modeling and visualization easier."
According to its official Documentation :The SpacePy project seeks to promote accurate and open research standards by providing an open environment for code development.
According to the description of its GitHub repository , it has superposed epoch classes, drift shell tracing, access to magnetic field models, streamline tracing, bootstrap confidence limits, time and coordinate conversions, and more.
Python can also be applied in many other areas, including:
There are many applications of Python in every area that you can possibly imagine. I hope that this article gave you an idea of the wide range of real-world applications of this programming language in industries that are currently shaping our world.
Remember that no matter which field you are in or which field you want to be in, learning Python will definitely open many doors for you. It is here to stay. And it has transformed and improved our current world and it will continue to do so for many years.
I really hope that you liked my article and found it helpful. Check out my online courses . Follow me on Twitter . ⭐️
Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started