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 […]
Uncategorized
6 Tips to change column positions with dplyr’s relocate()
Sometimes you want to change the order of columns in a dataframe. dpyr’s relocate() function makes it easy to move one or more columns to new positions easily by using the same syntax as select() function. In this post we will see 7 tips to change column order or column position using dplyr’s relocate(). Let […]
3 Different ways to add regression line in ggplot2
In this post, we will learn how to add simple regression line in three different ways to a scatter plot made with ggplot2 in R. This is something I have to google almost every time, so here is the post recording the options to add linear regression line. We will use palmer penguin data to […]
Pandas map: Change Multiple Column Values with a Dictionary
In this tutorial, we will learn how to use Pandas map() function to replace multiple column values using a dictionary. Earlier, we saw how to use Pandas replace() function to change the values in multiple columns using dictionary. As we all know, there are multiple solutions to a problem. Pandas map() function works with Pandas […]
Data Science Books on Black Friday Deals 2019
Amazon is running a limited time book deal on Black Friday 2019, in which you can get three books for the price of two books. (The offer is still available as of 7am (EST).) Basically if you buy three books from a list, you don’t pay for the book with the least price. Are you […]