00:00 As you’ve seen, the books dataset has a few columns that don’t have very much useful information. In this lesson, you’ll learn about dropping columns. That is, how to delete columns from a DataFrame.
So you want to drop columns. Removing is actually called dropping in pandas. You can use the conveniently named
.drop() method. You’ll also understand what
axes refer to when you’re using this method.
Continuing the method-chaining method here, going to called
.drop() on the end. And what you can pass in is an argument called
columns and a list of all the column titles that you want to drop, basically.
So now, if we look at the columns left, you have the ones that you want. An alternative way that you might see this written is without the
columns argument. However, it won’t know what you want these names to be.
Become a Member to join the conversation.