'Getting error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3131: invalid start byte [duplicate]
I am writing a command to join files on macbook M1 using Jupyter notebook, but I have a problem when joining CVS files in the following command. I will post the full code:
import pandas as pd
import os
files = [file for file in os.listdir("/Users/tadinhkhanh/Downloads/Training Python/Data Science/Tut Training Data Science (Youtube - Keith Galli) (Python + Numpy)/SalesAnalysis/Sales_Data")]
all_months_data = pd.DataFrame()
for file in files:
df = pd.read_csv("/Users/tadinhkhanh/Downloads/Training Python/Data Science/Tut Training Data Science (Youtube - Keith Galli) (Python + Numpy)/SalesAnalysis/Sales_Data/"+file)
all_months_data = pd.concat([all_months_data, df])
all_months_data.head()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|