Difference between Pandas where() function and mask() function

Pandas mask() and where() functions are two related functions that are useful in Pandas to find if elements of Pandas dataframe satisfy a condition. They both preserve the shape of the dataframe. In this post, we will first see simple examples of using Pandas where() and mask() functions and then we will learn the key… Continue reading Difference between Pandas where() function and mask() function

Seaborn version 0.12.0 with ggplot2-like interface

Add color, size to Seaborn Scatterplot object

It is just over a month since Seaborn version 0.12.0 is here with a huge update on the way we can make plots using Seaborn. Finally got a chance to test it out. Seaborn version 0.12.0 introduces seaborn.objects interface, inspired by Wilkinson’s grammar of graphics, offers “Pythonic API that is informed by the design of… Continue reading Seaborn version 0.12.0 with ggplot2-like interface

Pandas create new column using if else condition

Add new column using i condition on. existing column in Pandas

In this quick tutorial, we will learn how to create a new column using if else condition on an existing column in a Pandas dataframe. To add new column using a condional on existing column we will use Numpy’s where function. So, let us load both numby and Pandas to get started. We. will use… Continue reading Pandas create new column using if else condition

7 Dimensionality Reduction Techniques by Examples in Python

Dimensionality Reduction Techniques in Python

Dimension Reduction techniques are one of the most useful methods in unsupervised learning of high dimensional datasets. In this post, we will learn how to use Python to perform 7 most commonly used dimensionality reduction techniques by example, PCA: Principal Component Analysis SVD: Singular Value Decomposition ICA: Independent Component Analysis NMF: Non-negative Matrix Factorization FA:… Continue reading 7 Dimensionality Reduction Techniques by Examples in Python