Member-only story

Data Science

10 Quick Pandas Tricks to Energize your Analytics Project

Use these tricks to make your life easy as an analyst

Suraj Gurav
Towards Data Science
13 min readDec 7, 2022

--

Photo by SpaceX on Unsplash

Pandas is the popular data analytics library in Python. It certainly provides you the flexibility and the tools you need to process the data.

However, You must know time-saving and easy-to-use tricks for efficient working. That’s why I’m sharing 10 quick yet highly useful tricks in pandas, which you can master in under 10 minutes.

Even if you are already well versed with pandas methods and functions, you will still find some of these tricks actionable. If you are an absolute beginner, then this article is right place to start your learning.

Here is a quick index for your reference —

· Adjust the number of columns or rows to display
· Randomly sample rows with sample()
· Subset a dataframe with the query() method
· Round values in pandas DataFrame with round()
· Unpack the list values using the method explode()
· Create quick plots with the plot() method
· Return multiple DataFrames with display()
· Count unique values with nunique()
· Return a cumulative summary with cumsum()
· Aggregate by multiple functions using agg()

--

--

Towards Data Science
Towards Data Science

Published in Towards Data Science

Your home for data science and AI. The world’s leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.

Suraj Gurav
Suraj Gurav

Written by Suraj Gurav

Analytics professional and writer. I write about Data Science, Python, SQL & interviews. Join Medium today to get all my articles: https://tinyurl.com/3fehn8pw

Responses (1)