Pandas group-by function that helps perform the split-apply-combine pattern on data frames is bread and better for data wrangling in Python. Just came across a really cool blogpost titled “Group-by from scratch” by Jake Vanderplas, the author of Python Data Science Handbook. Jake implements multiple ways to implement group-by from scratch. It is a must […]
Python
Happy Pi(e) Day: How To Make Pie Chart in R and Python? (but Never Make it)
Happy Pi(e) Day! Pi Day is for celebrating the mathematical constant ? (pi) and it is on March 14 (3/14). It is also Albert Einstein’s birthday! Today is probably the only day you can think of making a Pie Chart. Pie Chart has been around for a while and notorious for eye-candy but misleading plots. […]
Catplot Python Seaborn: One Function to Rule All Plots With Categorical Variables
I just discovered catplot in Seaborn. Catplot is a relatively new addition to Seaborn that simplifies plotting that involves categorical variables. In Seaborn version v0.9.0 that came out in July 2018, changed the older factor plot to catplot to make it more consistent with terminology in pandas and in seaborn. The new catplot function provides […]
How To Make Grouped Boxplots in Python with Seaborn?
Boxplots are one of the most common ways to visualize data distributions from multiple groups. In Python, Seaborn potting library makes it easy to make boxplots and similar plots swarmplot and stripplot. Sometimes, your data might have multiple subgroups and you might want to visualize such data using grouped boxplots. Here, we will see examples […]
How To Visualize Sparse Matrix in Python?
When you work with sparse matrix data structure with SciPy in Python, sometimes you might want to visualize the sparse matrix. A quick visualization can reveal the pattern in the sparse matrix and can tell how “sparse” the matrix is. And it is a great sanity check. One way to visualize sparse matrix is to […]