什么是检查大型阵列在Python中是否相同的最快方法?

发布于 2025-02-07 22:01:59 字数 388 浏览 0 评论 0原文

我正在使用采用两种形式的大型数据集。

  1. 一组.TIFF文件(即2048 x 2048 .TIFF图像的2000个文件)
  2. ,其中包含一个〜2000x2048x2048数组。

我正在编写代码,该代码将获取所有.TIFF文件并将其重写为HDF5文件,以使上传和下载更容易,但是我希望能够编写一些内容以检查是否已经存在HDF5文件,并且如果是这样,请检查HDF5文件是否具有2000x2048x2048数组,如果有的话,该数组中包含的数据是否与2000 .TIFF文件相同。

前两个步骤(检查HDF5文件以及它是否包含巨大的数组)很简单。但是,最快的合理方法是在Python中完成最后一位(查看数据是否相同)?理想情况下,我希望不需要多长时间才能制作另一个冗余HDF5文件所需的时间。

I'm working with large datasets that take two forms.

  1. A set of .tiff files (i.e. roughly 2000 files of 2048 x 2048 .tiff images)
  2. An enormous hdf5 file which contains a ~2000x2048x2048 array.

I'm writing code that will take all the .tiff files and re-write them as a hdf5 file to make uploading and downloading easier, but I'd like to be able to write something to check if a hdf5 file is already present and if it is, to check whether that hdf5 file has the 2000x2048x2048 array and if it does, whether the data contained in that array is identical to the 2000 .tiff files.

The first two steps (check for hdf5 file and whether it has a huge array in it) are simple enough. But what's fastest reasonable way to do the last bit (see if the data are identical) in python? Ideally, I'd like something that doesn't take as long to check as it would take to just make another redundant hdf5 file.

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

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

发布评论

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