Scatter plots are a useful visualization when you have two quantitative variables and want to understand the relationship between them. In this post we will see examples of making scatter plots using Seaborn in Python. We will first make a simple scatter plot and improve it iteratively. Let us first load the packages we need […]
Python
How To Select Columns Using Prefix/Suffix of Column Names in Pandas?
Selecting one or more columns from a data frame is straightforward in Pandas. For example, if we want to select multiple columns with names of the columns as a list, we can one of the methods illustrated in How To Select One or More Columns in Pandas? Sometimes you may be working with a larger […]
How to Get Top N Rows with in Each Group in Pandas?
In this post we will see how to get top N rows from a data frame such that the top values of a specific variable in each group defined by another variable. Note this is not the same as top N rows according to one variable in the whole dataframe. Let us say we have […]
How To Select One or More Columns in Pandas?
Selecting a column or multiple columns from a Pandas dataframe is a common task in exploratory data analysis in doing data science/munging/wrangling. In this post, we will see examples of How to select one column from Pandas dataframe? How to select multiple columns from Pandas dataframe? Let us first load Pandas library Let us use […]
How to Select Top N Rows with the Largest Values in a Column(s) in Pandas?
Sometimes, while doing data wrangling, we might need to get a quick look at the top rows with the largest or smallest values in a column. This kind of quick glance at the data reveal interesting information in a dataframe. Pandas dataframe easily enables one to have a quick look at the top rows either […]