【问题标题】:can't open a shape file with pysal无法使用 pysal 打开形状文件
【发布时间】:2020-05-21 23:29:43
【问题描述】:

我尝试使用带有该代码的 pysal 打开文件:

import pysal
f=pysal.open()

这是我得到的回应:

AttributeError: module 'pysal' has no attribute 'open'

我做错了什么?

【问题讨论】:

  • API 随 pysal 版本 2 更改

标签: python spatial pysal


【解决方案1】:

pysal 发布了版本 2 的重大更改。open 不再是顶级导入。

您仍然可以使用 pysal 打开 shapefile,但您需要先导入 pysal.lib.io.open

导入 pysal.lib.io.open pysal.lib.io.open('路径/to/file.shp')

【讨论】:

    猜你喜欢
    • 2013-10-25
    • 2011-10-12
    • 1970-01-01
    • 1970-01-01
    • 2019-01-06
    • 1970-01-01
    • 2010-12-17
    • 2020-12-15
    • 1970-01-01
    相关资源
    最近更新 更多