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') 
1
  • Can we see how you generate the listOfFiles? It's likely possible to exclude .DS_Store from the array Commented May 1, 2020 at 23:54

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.