How to select several columns in a Pandas DataFrame?

In today’s post we’ll learn to subset multiple columns from a Pandas dataframe. We’ll look into three methods: Slicing using the “brackets notation” Using the loc indexer Using the iloc indexer Data Preparation Go ahead and import the pandas library into your Python development environment and create your DataFrame. Here’s our DataFrame: language avg_salary candidates … Read more

How to insert a new row in a Pandas DataFrame?

In today’s data wrangling tutorial, we’ll learn a few methods that are readily available in Python in order to insert records into Pandas DataFrame. We’ll start by loading a simple dataset to our Jupyter Notebook / Lab Namespace: Create a new row as a list and insert it at bottom of the DataFrame We’ll first … Read more

How to drop one or multiple columns in a Pandas Dataframe?

In today’s Data Wrangling tutorial we’ll learn how to manipulate Pandas DataFrames by removing one or more columns from them. In all examples we’ll use the DataFrame.drop() method, to subset our data so we can focus our analysis. Define and load example dataset We’ll start by loading the Python Pandas library and creating our dataset … Read more