pygeos.strree还不能腌制

发布于 2025-02-07 10:36:58 字数 1262 浏览 2 评论 0原文

我正在尝试阅读具有GEO DTATFRAME的泡菜文件。 它在Colab上工作正常,直到我重新启动运行时间

test = 'derived edges.pkl'  
testdf = pd.read_pickle(test)  
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-13-eb97f2da93db> in <module>()
      1 test = 'derived edges.pkl'
----> 2 testdf = pd.read_pickle(test)

1 frames
/usr/local/lib/python3.7/dist-packages/pandas/io/pickle.py in read_pickle(filepath_or_buffer, compression, storage_options)
    215                     # RawIOBase, BufferedIOBase, TextIOBase, TextIOWrapper, mmap]";
    216                     # expected "IO[bytes]"
--> 217                     return pickle.load(handles.handle)  # type: ignore[arg-type]
    218             except excs_to_catch:
    219                 # e.g.

/usr/local/lib/python3.7/dist-packages/geopandas/array.py in __setstate__(self, state)
    422     def __setstate__(self, state):
    423         if compat.USE_PYGEOS:
--> 424             geoms = pygeos.from_wkb(state[0])
    425             self._crs = state[1]
    426             self._sindex = None  # pygeos.STRtree could not be pickled yet

KeyError: 0

I'm trying to read the pickle file that has a geo dtatframe.
It was working fine on colab until I restarted the runtime

test = 'derived edges.pkl'  
testdf = pd.read_pickle(test)  
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-13-eb97f2da93db> in <module>()
      1 test = 'derived edges.pkl'
----> 2 testdf = pd.read_pickle(test)

1 frames
/usr/local/lib/python3.7/dist-packages/pandas/io/pickle.py in read_pickle(filepath_or_buffer, compression, storage_options)
    215                     # RawIOBase, BufferedIOBase, TextIOBase, TextIOWrapper, mmap]";
    216                     # expected "IO[bytes]"
--> 217                     return pickle.load(handles.handle)  # type: ignore[arg-type]
    218             except excs_to_catch:
    219                 # e.g.

/usr/local/lib/python3.7/dist-packages/geopandas/array.py in __setstate__(self, state)
    422     def __setstate__(self, state):
    423         if compat.USE_PYGEOS:
--> 424             geoms = pygeos.from_wkb(state[0])
    425             self._crs = state[1]
    426             self._sindex = None  # pygeos.STRtree could not be pickled yet

KeyError: 0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文