subset= table['name']
name2suid = {}
for suid in subset.index:
name2suid[subset[suid]] = suid
table.set_index(["SUID"],inplace=True)
There is no reason in resetting the index even after the loop for, because the table is no longer used in the body of that method.
Apparently, it doesn't hurt, but after the first index reset, there is no column SUID to set it as index
and the method ends by displaying the error
Key 'SUID'
The static method
util.name2suid
repeats n times index resetting,table.set_index(["SUID"], inplace=True)
, wheren=len(list(table_index))
https://github.com/cytoscape/py2cytoscape/blob/develop/py2cytoscape/data/util_network.py:There is no reason in resetting the index even after the loop
for
, because the table is no longer used in the body of that method. Apparently, it doesn't hurt, but after the first index reset, there is no columnSUID
to set it as index and the method ends by displaying the errorKey 'SUID'
Cytoscape 3.7.1, Java 1.8.0_162