【发布时间】:2020-05-21 23:29:43
【问题描述】:
我尝试使用带有该代码的 pysal 打开文件:
import pysal
f=pysal.open()
这是我得到的回应:
AttributeError: module 'pysal' has no attribute 'open'
我做错了什么?
【问题讨论】:
-
API 随 pysal 版本 2 更改
我尝试使用带有该代码的 pysal 打开文件:
import pysal
f=pysal.open()
这是我得到的回应:
AttributeError: module 'pysal' has no attribute 'open'
我做错了什么?
【问题讨论】:
pysal 发布了版本 2 的重大更改。open 不再是顶级导入。
您仍然可以使用 pysal 打开 shapefile,但您需要先导入 pysal.lib.io.open
导入 pysal.lib.io.open pysal.lib.io.open('路径/to/file.shp')
【讨论】: