DataFrame index must be unique for orient='index'

hello~I am trying to use the HQ model for my research,I downloaded the sample data from the official website and I was able to run it successfully. But my own data, it shows error. I don’t know what’s wrong. Help me! Thank you all~

My data and where it’s stored

Hi @sun, and welcome to the forum!

That’s an interesting error. Please post the entire log file (ends in .txt) that the model produces in your Workspace. It contains more information that might help us understand what’s going wrong. Thanks!

~ Stacie

InVEST-Habitat-Quality-log-2021-06-09–22_08_24.txt (1.8 KB)
thanks for your reply!

Thanks for posting your logfile @sun. It includes this error message:

2021-06-09 22:08:24,529 utils.build_lookup_from_csv(544) ERROR The ‘key_field’ : ‘threat’ column values are not unique: [‘a’, ‘r’, ‘g’, ‘t’, ‘u’, ’ ', ’ ']

It looks like you have two columns with blank field names, which I’m guessing contain no corresponding threat data either, so they could be deleted. So I recommend looking at your threat table, and make sure that the columns are formatted correctly, with unique column names (and no blank column names). Sometimes it’s hard to see problems when looking at the table in Excel, so I recommend viewing it in a text editor (like Notepad in Windows), where you can more easily see the actual .csv formatting.

~ Stacie

1 Like