Behind AI #8: Here's Everything You Can Do With Python
Python is the language of choice for AI & data science. Discover what other things you can do with Python (plus free tutorials to get started).
Whether you’re new to programming or an experienced developer, Python has one or two applications that might interest you.
The best thing is that you don’t need to be an expert programmer to get started with Python. Python’s syntax makes Python code similar to natural language, which makes it even easier for beginners to learn.
In this article, I’ll list all the things you can do with Python from simple applications that don’t require previous knowledge to advanced stuff that requires knowledge in other fields besides programming.
I’ll leave links to free tutorials to get you started.
Automation
Probably the most fun and easiest application of Python is automation. You don’t need to become an expert in Python to build simple automation that will save you from doing repetitive tasks.
The only thing you need to do is find something worth automating and then learn the Python libraries that will help you automate this task.
What can you automate with Python?
What’s worth automating? It can be anything. Here are my favorite automation scripts I built so far:
Automating Morning News
Sending Emails
Automating Boring Excel Reports
Whatsapp Messages
Tinder
Here’s how I used Python to send messages on WhatsApp (believe it or not the message is sent by a bot).
After you write a script to automate a task, you can schedule it to be run at any time you want. Forget about doing any boring task manually!
If you’re still unsure of where to start, I recommend you start with web automation. There are millions of websites out there that you can automate with a single Python library: Selenium.
Free Tutorials: 3 automation projects
Web Scraping
Web scraping is all about collecting data from websites. This is a skill that data analysts and data scientists should have, but it can be used in any field where there’s a need for data.
Web scraping is a technique that consists in creating scrapers (aka automated bots) that extract millions of data points from the internet. This is similar to copying data from a website and then pasting it into a spreadsheet. That said, it can take us hours to do this task manually, however, a web scraper will do this in a couple of minutes (or seconds!).
In this video, you can find everything you need to know about web scraping explained in 3 minutes.
In Python, we can scrape websites using libraries such as Beautiful Soup, Selenium, and Scrapy. Beautiful Soup is an easy-to-learn library but has lots of limitations. Selenium is a web automation library that can scrape JavaScript-driven websites but is a bit slow. In contrast, Scrapy is a robust framework that has multiple functionalities and is faster than the other 2 libraries.
You can scrape most websites out there. To name a few:
Twitter
Amazon
Airbnb
News Sites
Free tutorials: Beautiful Soup, Selenium, Scrapy
Data Analysis & Data Science
Data is one of the most valuable things on the internet. Some even call data “the new oil of the 21st century.”
Regardless of whether that’s true or not, the large amount of data available on the internet and possessed by big organizations is undeniable. According to IBM, the global volume of data was predicted to reach 35 zettabytes in 2020.
With so much data out there, there’s a demand for professionals to work with this data and get value from it. Here’s when data analysts and data scientists come into play.
In data analysis, we use Python to clean data, wrangle data and create visualizations. We use Python libraries such as Pandas, Numpy, Matplotlib, and Seaborn to do that.
In data science, we usually go one step further and use Python to develop a machine learning model that predicts outputs based on data we feed to our model.
Here is all the Python stuff you need to learn for data science explained in 5 minutes.
Machine learning is often used in data science, so at least you should learn sklearn, which is the most basic library to do machine learning in Python. This library is the foundation for other advanced Python libraries such as TensorFlow and Keras.
Some models you can build with machine learning are:
Fake News Detection
Credit card fraud detection
Customer Churn Prediction
Free Course: Data Analysis with Python
Web Development
If you ever dreamt of building your own website, I have good news for you — you can do it with Python!
Python has some frameworks like Flask and Django that allows us to build the back end of a website with Python. Of course, to build the front end you still need to use HTML, CSS, and JavaScript. That said, you have nothing to worry about since HTML is a very simple language and you could use Bootstrap to avoid implementing CSS and JavaScript code from scratch.
What websites were built using Python?
There are many websites out there that use Python for the back-end of their websites. Here are some of them.
Some of these websites used Python in early stages, while others still use it to this date. In fact, Instagram currently features the world’s largest deployment of the Django web framework (written entirely in Python).
Below you’ll find more about how Python powers these websites:
Here are some free tutorials to get you started with web development.
Free Tutorials: Python Website Tutorial with Flask, Django For Beginners
Machine Learning & Artificial Intelligence
Machine learning is a branch of artificial intelligence that allows a machine to automatically learn from past data without programming explicitly.
This isn’t something that you can learn solely with Python but requires knowledge in linear algebra, calculus, and more. With Python, we can use scientific libraries such as Numpy, Pandas, PyTorch, and TensorFlow to take care of all the math behind a machine learning model. Your job will be to understand the results and make the best decision using your analytical skills.
Here are some popular machine-learning applications:
Google’s self-driving car
Recommendation systems from Amazon, YouTube, and Netflix
Fraud detection
Of course, those are advanced applications. Before you dive into Machine Learning and AI you need to have a solid foundation in calculus, and linear Algebra and know Python libraries such as NumPy, pandas, Matplotlib, and PyTorch.
Once you familiarize yourself with the basics of machine learning you can learn more advanced Python libraries like TensorFlow and Keras.
Below are free tutorials that you can take to learn these libraries.
Free Tutorial: TensorFlow 2.0 — Python Neural Networks for Beginners Tutorial
Once you acquired the previous skills, the sky is the limit!
You can use this knowledge to specialize in more advanced topics like NLP, AI, and DL.
That’s it! Let your Python journey begin!