I'm recently using pandas to read dataframe from a CSV file. Upon calling the reading the Csv file I also have to include 'utf-8' in order to not get the following error
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x84 in position 19: invalid start byte
So I go and modify the code like this
df = pd.read_csv('file.csv', 'utf-8' )
This gets rid of the error, Is there a way to not get this error without including 'utf-8' ?
I have to include skipinitialspace=True on my code and I'm note sure how to include it in the line. The following code gives me an error
df = pd.read_csv('file.csv', skipinitialspace=True, usecols=fields, 'utf-8')