How to Replace Outliers with the 5th and 95th Percentile Values in Python

Outliers are observations that lie an abnormal distance from other values in a random sample from a population. They’re usually harmful to most data analysis procedures because they can skew your dataset and give misleading results.

In Python, you can identify and replace these outliers with the 5th and 95th percentile values. This tutorial will guide you on how to go about it.

Continue reading

How to Split on Backslash in Python

In this tutorial, we will look at how to split a string on a backslash in Python. Performing operations on strings is one of the most common tasks in Python. Especially extracting data from strings with specific patterns.

A backslash ‘\’ is often used as a delimiter to separate strings, but it has a special meaning in Python – it is an escape character. Thus, it requires a little more finesse to handle it. So, let’s delve into it.

Continue reading

How to Get a Range of Characters in Python

In this tutorial, we will be learning about how to get a range of characters in Python. Python, being a powerful and flexible programming language, provides various ways to get a range of characters from strings.

This process is also known as slicing. It’s a rather simplistic but extremely useful concept, essential to any kind of data manipulation in Python.

Continue reading

How to Set Y-ticks in Python

In this tutorial, we are going to learn how to set y-ticks using Python. This is an incredibly useful skill when dealing with matplotlib, a popular library in Python.

The proper use of y-ticks can highly improve the clarity and comprehension of your charts. We will first cover the basics of y-ticks then move on to customizations and different methods of implementing them.

Continue reading

How to Create a Heatmap in Python

In this guide, we’ll delve into creating a heatmap in Python. A heatmap is a graphical representation of data where individual values contained in a matrix are represented with colors.

This is a very insightful way to understand complex data at a glance. No prior experience with any specific libraries is required, but a general understanding of programming concepts and Python syntax will be helpful.

We’ll primarily use the Seaborn and Matplotlib libraries in this tutorial.

Continue reading

How to Capitalize Specific Letters in Python

Python is highly acclaimed for its simplicity and readability. It’s often used for various tasks, including text manipulation.

One common use case involves changing the capitalization of certain characters in a string. In this tutorial, we will walk you through methods to capitalize specific letters in Python using the string methods and string manipulation techniques made available by the language.

Continue reading

How to Find Common Words in Two Text Files Using Python

In this tutorial, we will learn how to find common words in two text files using Python. The Python language is highly versatile and useful for many tasks, including text analysis. We’ll be utilizing some of its inbuilt methods and libraries to accomplish our task

Python’s built-in libraries have fantastic methods for handling and manipulating file and string data. set() and open() methods are among those that will be of use in this tutorial. We’ll only need your base Python installation for this, so no additional downloads are required.

Continue reading