Black Lives Matter. Please consider donating to Black Girls Code today.

Error processing file when trying to read .mat file.- Dash-Upload Component

Hi,

Using the Upload Component example from the Dash website: https://dash.plot.ly/dash-core-components/upload, I replaced the lines of code for reading a .csv file with that of reading in a .mat file (Matlab). However, for whatever reason when I run the script, and after selecting the file, it returns back the following error message; ‘There was an error processing this file.’ From the snippet below, lines 57-60 are the new lines of code and I also removed the elif statement. This lines of code that I replaced with work properly in a separate script file that I have.

Could the error code from line 67, have to do with the code for df_to_dict code on line 76?

I’d recommend putting in a python breakpoint and inspecting the file and the exception (import ipdb; ipdb.set_trace())