Numpy - Unable to load data
I try to load data, but I get this error message: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 341: invalid start byte
Does anyone know what I can do. numpy version: '1.19.2' Code: raw_data_np = np.genfromtxt("loan-data.csv", delimiter = ';', skip_header = 1, autostrip = True)
raw_data_np
I am facing the same issue. Kindly share if someone has been able to resolve this.
I missed your question and just posted this very question. Hope we can get a resolution. Annoying the data set won't load.
If anyone is sitll looking and hasn't found the answer, I had to add this:
raw_data_np = np.genfromtxt('loan-data.csv', delimiter=';', encoding= 'unicode_escape')
raw_data_np
Also, this seems to work as well: "encoding='cp1252'"
Found the answers quite by accident here: https://www.codegrepper.com/code-examples/python/+genfromtxt+UnicodeDecodeError%3A+%27utf-8%27+codec+can%27t+decode+byte+0xfe+in+position+341%3A+invalid+start+byte