Data Science Jumpstart with 10 Projects Transcripts
Chapter: Project 5: Cleaning Heart Disease Data in Pandas
Lecture: Fixing the Age Column Type to Int8

Login or purchase this course to watch this video and the rest of the course contents.
0:00 I'm going to start going through the columns. We'll start off with the age column. So here's our data frame. You can see age is
0:07 in that first column there. Let's do a describe on that. It looks like we are going from 28 to 77. That looks okay. Let's do a histogram
0:17 to understand what's going on there. Seems perfectly plausible. Let's look at the D type of that. The D type is a double pie arrow.
0:27 Let's see if we can get away with casting it to an int8. Pie arrow will complain if this doesn't work. It looks like that does work.
0:37 I think I'm pretty good here leaving this as an int8 and I don't have much more to do with this column.


Talk Python's Mastodon Michael Kennedy's Mastodon