Member-only story

Cool Python Tweaks To Add In Every Project

Manpreet Singh
4 min readJun 6, 2022

--

Welcome back! Python is an awesome programming language with a ton of capability, if you’re new to Python, check out the link below to learn more about it:

So, let’s take a look at some cool Python tweaks you can add in every project!

Hiding Warnings

There are many situations where you might get a warning, these usually are shown if a package you imported is outdated or you do things in your Python environment that are “legal” but may not be the best way to do it:

If you want to remove these types of warnings, all you have to do is put the following lines of code at the very top of your script:

import warnings
warnings.filterwarnings(action='ignore')

Getting Random Data

Next up, let’s take a look at getting random data from a dataset. Let’s use the list that we created…

--

--

Manpreet Singh
Manpreet Singh

No responses yet