Open
Description
Question Description
In line 372 of the libpysal/weights/weights.py file, the getattr
function is called to assign a value to try_weightcol
. However, since the third parameter of getattr
(the default value to be returned when the attribute is not found) is not passed, it will result in an AttributeError: 'DataFrame' object has no attribute 'weight'
if the 'weight_col' column is not present in the 'adjlist', and this will terminate the program.
So, when will the code at lines 373-375 be executed?
if try_weightcol is None:
adjlist = adjlist.copy(deep=True)
adjlist["weight"] = 1
Essential Information
- Platform information: nt win32
- Python version: 3.10.11[MSC v.1934 64 bit (AMD64)]
- SciPy version:1.10.1
- NumPy version:1.24.3
Metadata
Assignees
Labels
No labels
Activity