From the course: Python for Data Visualization (2019)
Unlock this course with a free trial
Join today to access over 22,500 courses taught by industry experts.
Renaming and deleting columns
From the course: Python for Data Visualization (2019)
Renaming and deleting columns
- [Narrator] When you have a data set, it's often the case where you want to change your column names to make the more legible, more understandable, or more easy to program with. Or sometimes you want to remove unnecessary columns. An advantage of removing unnecessary columns is it can free up RAM on your computer. It's also a good data science practice. There are two popular ways to rename data frame columns. The first is dictionary substitution, which is very useful if you only want to rename a few of your columns. There's also list replacement, which requires a full list of names, and in my experience, this is more error prone. The data set we're going to work with is the car loan data set. And we'll look at the first five rows using the head method. And one reason why I want to rename a column, in this case, the principal paid column, is if I try to use the dot notation wire the data frame and a dot, and the column I'm interested in, this will yield an error.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Introduction to pandas52s
-
Create sample data3m 50s
-
Load sample data2m 17s
-
Basic operations1m 57s
-
Slicing4m 12s
-
Filtering5m 39s
-
Renaming and deleting columns3m 16s
-
Aggregate functions2m 39s
-
Identifying missing data3m 41s
-
Removing or filling in missing data5m 3s
-
Convert pandas DataFrames to NumPy arrays or dictionaries1m 15s
-
Export pandas DataFrames to CSV and Excel files1m 28s
-
-
-
-