Member-only story
5 Pandas Functions That I Think You Hardly Ever Used
But you should.
Pandas might be the most versatile tool in the data analysis and manipulation scope. What makes it so is the rich selection of functions and methods.
In this article, I will mention 5 functions that I think you hardly ever used. You won’t need them quite often but there will be cases where these functions offer a practical solution. Besides, they are fun to learn 😊
The aforementioned 5 functions are:
- truncate
- filter
- duplicated
- first
- nlargest
As always, we will learn them with examples.
1. truncate
This function truncates a DataFrame or Series based on the specified index value. Both column and row index can be used. In a sense, the truncate function filters a DataFrame or Series using the index instead of their content.
Let’s do a couple of examples to show how it works. We will create a DataFrame first.
import numpy as np
import pandas as pd
df = pd.DataFrame(…