1

I'm using python to read CSV files inside a folder and after to perform calculations.

Some times inside the folder there are ".DS_Store files". When the algorithm reads one of those files everything blows up.

Those files are easy to delete manually.

How can I achieve a built-in function inside my code? (here is the part of the code that reads the files)

for i in range(10):
    M1 = genfromtxt(listOfFiles[i], delimiter=',', encoding='unicode_escape') 
Alireza HI
  • 1,873
  • 1
  • 12
  • 20
  • Can we see how you generate the `listOfFiles`? It's likely possible to exclude `.DS_Store` from the array – McKay M May 01 '20 at 23:54

1 Answers1

0

You probably don't need to delete the .DS_Store file.

You can select only the .CSV to read. This thread discusses some ways to do so.

McKay M
  • 448
  • 2
  • 8