【问题标题】:Silence warning in PySAL weights command using geopandas df使用 geopandas df 的 PySAL 权重命令中的静音警告
【发布时间】:2018-10-13 23:40:33
【问题描述】:

我正在计算 geopandas df 的权重矩阵。我知道有一个关键字可以让我消除孤岛警告 (pysal doc),但是当我尝试使用它时遇到关键字错误...

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

错误...

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

任何帮助将不胜感激。谢谢!

【问题讨论】:

  • 你用的是什么版本的pysal?
  • 我使用的是 1.14.2 版本。

标签: gis geospatial pysal


【解决方案1】:

辅助函数使用“silent”参数,而 W 对象使用“silent_island_warning”参数。

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

查看来源:https://github.com/pysal/pysal/blob/master/pysal/weights/Distance.py

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-06-15
    • 2021-03-07
    • 1970-01-01
    • 2021-04-25
    • 1970-01-01
    • 2021-07-19
    • 2022-12-18
    相关资源
    最近更新 更多