Search code examples
gisgeospatialpysal

Silence warning in PySAL weights command using geopandas df


I am calculating a weights matrix for a geopandas df. I know there is a keyword that will allow me to silence the island warning (pysal doc), but I get a keyword error when I try to use it...

wt = ps.weights.DistanceBand.from_dataframe(df, threshold=600000, binary=True, silent_island_warning=True)

Error...

TypeError: __init__() got an unexpected keyword argument 'silent_island_warning'

Any help would be much appreciated. Thanks!


Solution

  • The helper functions use the 'silent' argument, as opposed to the W object which uses the 'silent_island_warning' argument.

    wt = ps.weights.DistanceBand.from_dataframe(df, threshold=600000, binary=True, silent=True)
    

    See source: https://github.com/pysal/pysal/blob/master/pysal/weights/Distance.py