From the course: Python for Data Visualization
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Rename and delete columns - Python Tutorial
From the course: Python for Data Visualization
Rename and delete columns
- [Instructor] When you have a data set, it's often the case where you want to change your column names to make them 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 and 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 a 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 principle paid column, is if I try to use the dot notation where the data frame and a dot and the…
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
-
-
-
-
(Locked)
Introduction to pandas1m 30s
-
(Locked)
Create sample data3m 50s
-
(Locked)
Load sample data2m 17s
-
(Locked)
Basic operations1m 57s
-
(Locked)
Simplify with slicing4m 12s
-
(Locked)
Filter and clean data5m 39s
-
(Locked)
Rename and delete columns3m 16s
-
(Locked)
Aggregate functions2m 39s
-
(Locked)
Identify missing data3m 41s
-
(Locked)
Remove or fill in missing data5m 3s
-
(Locked)
Convert pandas DataFrames1m 15s
-
(Locked)
Export pandas DataFrames1m 28s
-
(Locked)
-
-
-