From the course: Practical Python for Time Series Analysis

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Automate loading with for loops

Automate loading with for loops

- [Instructor] This time, we'll visualize more than two time series data files in the same chart as we observe in the data folder. But in this video, we'll go beyond because we will iterate using a for loop, automating the process for seamless loading of multiple datasets. The concat function needs a list of multiple time series data frames for which we have repeated the same code, just changing the path. We must identify which is the thing that is changing every single time, and that is the path. So at the beginning, we will use a list of paths. Now, we iterate for each path to become the ones that we have in the list. And inside the for loop, we want to save it into the data frame by reading the CSV and storing it into an empty list that we must define at the beginning with the data frames. Because that list will accumulate all of the data frames processed, having the date time column as the index, and parsing the…

Contents