[Python] How do I delete .ds_Store file on mac

Discussão em 'Python' iniciado por Stack, Março 9, 2025.

  1. Stack

    Stack Membro Participativo

    df = pd.read_csv("/Users/georgezambrano/Desktop/Code/Sales_Data/Sales_April_2019.csv")

    files = [file for file in os.listdir('/Users/georgezambrano/Desktop/Code/Sales_Data')]

    all_months_data = pd.DataFrame()

    for file in files:
    df = pd.read_csv("/Users/georgezambrano/Desktop/Code/Sales_Data/"+file)
    all_months_data = pd.concat([all_months_data, df])

    all_months_data.head()


    UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3131: invalid start byte


    I believe I'm getting the error due to a .ds_store file that shows up when I print the list of files. However, the file .ds_store isn't visible in the folder so I'm really not sure how to delete it.

    Continue reading...

Compartilhe esta Página