Colors must be aRGB hex values?

Viewed 4198

So I was previously running some code for a pollution dataset, and the code was running just fine. Now, I get this error: Colors must be aRGB hex values

The only line of code I have is the following:

pollution_jawn = pd.read_excel('ObservationData_irkfioc copy.xlsx')

I have no idea what the issue is, and I even tried deleting this file from my jupyterhub directory and uploading it, but even that did not work.

3 Answers

As mentioned by the other answer, a workaround this is to specify engine='xlrd' in pd.read_excel. However, for this to work, xlrd must be in version 1.2.0 (or lower).

To download the specific version (using anaconda), type in your terminal conda install -c anaconda xlrd=1.2.0.

After that is done, this should work (mind that you will get a FutureWarning, as this version of xlrd is deprecated:

pollution_jawn = pd.read_excel('ObservationData_irkfioc copy.xlsx', engine='xlrd')

Had a similar issue after I updated to pandas 1.2.3. What worked for me is to specify

pd.read_excel(path_to_xlsx, engine='xlrd')

I suspect that the xlsx file I loaded used an older xls standard somewhere, since the option "xlrd supports old-style Excel files (.xls)" (from the docs)

The .xlsx file was probably saved in an older version of Excel. What worked for me was to simply open the .xlsx file in a new version of Excel and then save it again. After that the error didn't turn up again.

Related