Skip to content
Advertisement

iterating over folders executing a fuction at each 2 folders

I have a function called plot_ih_il that receives two data frames in order to generate a plot. I also have a set of folders that each contain a .h5 file with the data I need to give to the function plot_ih_il… I’m trying to feed the function two datasets at a time but unsuccessfully.

I’ve been using pathlib to do so

JavaScript

but using this loop, I can only feed one data frame at a time, I need two of them.

The structure of the folders is something like,

JavaScript

I would like to feed the function plot_il_ih the following sequence,

JavaScript

I have tried to use zip

JavaScript

but it doesn’t move forward, just opens the 2 firsts.

What is wrong with my logic?

Advertisement

Answer

consider something like this. You might have to play around with the indexing

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement