gpt4 book ai didi

python - 使用 pytables 构造巨大的 numpy 数组

转载 作者:行者123 更新时间:2023-11-30 09:25:10 26 4
gpt4 key购买 nike

我从大量数据中生成示例的特征向量,并且我想在读取数据时增量存储它们。特征向量是 numpy 数组。我事先不知道 numpy 数组的数量,我想增量存储/检索它们。

查看 pytables,我发现了两个选项:

  1. 数组:它们需要预先确定的大小,但我不太确定如何大量追加在计算上是高效的。
  2. 表格:列类型不支持列表或数组。

最佳答案

如果它是一个普通的 numpy 数组,您可能应该使用可扩展数组 (EArray) http://pytables.github.io/usersguide/libref/homogenous_storage.html#the-earray-class

如果您有 numpy 结构化数组,则应该使用表。

关于python - 使用 pytables 构造巨大的 numpy 数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16068118/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com