Pathlib: Iterate Over All Files that End with ‘.csv’ in a Directory

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.

Related Posts

Related Posts

Scroll to Top