If you want to apply the same script to the different data, you might want to iterate over files in a directory that contains data. To do that, the easiest way is to use pathlib.
In the code above, I iterate over all files that end with ‘.csv’ in ‘data’ directory.