Data Science Jumpstart with 10 Projects Transcripts
Chapter: Project 5: Cleaning Heart Disease Data in Pandas
Lecture: Loading Multiple Files into a Single Pandas Datafarme with Glob

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Let's load our libraries, we're going to load NumPy and Pandas, we're also going to load the Glob module, the Glob module lets you load multiple files.
0:10 So if you look at this code down here, we are loading these processed star.data files, there's multiple of those,
0:18 and I want to combine them into a single data frame. So this code down here will load all of the files, I've got a list comprehension inside of that,
0:27 and then we're using the pdConcat function to concatenate those along the index, essentially stacking them on top of each other.
0:37 Note that I said ignore index is true, that makes it so the index values do not get repeated. Okay, that looks like we've loaded our data.


Talk Python's Mastodon Michael Kennedy's Mastodon