Errors with using Weight Matrix

1016
4
Jump to solution
12-07-2016 03:47 AM
PhilipKoppels
New Contributor II

Hello, I hope someone can help me with the following issue.

I'm trying to run various procedures from the spatial statistic toolbox (e.g. Morans I) that require a weight matrix. For this I have created a weight matrix file through the 'Generate Spatial Weights Matrix' tool. However, when I load this Weight Matrix in the 'Spatial Autocorrelation' tool I get the following error message: ValueError too many variables to unpack. The strange thing is that if I specify exactly the same weight matrix directly in the 'Spatial autocorrelation' tool it works fine. However, I want to specify a specific weigh matrix that can only be created with 'Generate Spatial Weights Matrix' tool and not ‘inside’ the 'Spatial Autocorrelation' tool itself. Any ideas what might be causing this, because I have experimented a lot, but can’t figure it out. Thanks!

0 Kudos
1 Solution

Accepted Solutions
PhilipKoppels
New Contributor II

My folder name contained ‘@’ symbol and that seems to have caused the error. After moving the files to a different folder the procedures worked as planned. Thanks for the help!

View solution in original post

0 Kudos
4 Replies
DanPatterson_Retired
MVP Esteemed Contributor

Why not have a look at this Convert Spatial Weights to Table maybe that is a workaround

0 Kudos
PhilipKoppels
New Contributor II

Thank you for your reply. I have tried that as well, but it yields exactly the same error: ValueError too many variables to unpack. I have also imported a weight matric that I have generated outside (eith GeoDa) and tried to row standardize it with Generate Spatial Weights Matrix tool, but when I try to use the matrix I again get the same error. I think it might be a software issue and today I will try to the same procedure with a different computer. Let’s see if I get the same error….   

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

sounds like a python error or a similar error in another language... 

here is how it is generated

>>> a, b = [1,2,3,4]
Traceback (most recent call last):
 File "<string>", line 1, in <module>
ValueError: too many values to unpack (expected 2)
0 Kudos
PhilipKoppels
New Contributor II

My folder name contained ‘@’ symbol and that seems to have caused the error. After moving the files to a different folder the procedures worked as planned. Thanks for the help!

0 Kudos