Data Science Jumpstart with 10 Projects Transcripts
Chapter: Project 5: Cleaning Heart Disease Data in Pandas
Lecture: Comparing Memory usage in Pandas with memory_usage

Login or purchase this course to watch this video and the rest of the course contents.
0:00 In this section we're going to look at memory usage and compare memory usage from before and after. Here is our original memory usage, 396 kilobytes.
0:11 Let's run through our code and do our memory usage and we get 34 kilobytes. When we compare that we're using 11 times less memory by going through this
0:23 process. Again there's no guarantee that you will use 11 times less memory and
0:27 this is partly because we're using all these object columns so those consume a
0:31 little bit more memory. But we did save a bit of memory by going through this.
0:36 If we were to go back to the pandas1 types of columns we would use even more memory. So this is pretty good, pretty good cleanup. We haven't lost any
0:48 information but we've cleaned up the types.


Talk Python's Mastodon Michael Kennedy's Mastodon