_tifffile.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:radar 作者: amoose136 项目源码 文件源码
def read_array(self, dtype, count=-1, sep=""):
        """Return numpy array from file.

        Work around numpy issue #2230, "numpy.fromfile does not accept
        StringIO object" https://github.com/numpy/numpy/issues/2230.

        """
        try:
            return numpy.fromfile(self._fh, dtype, count, sep)
        except IOError:
            if count < 0:
                size = self._size
            else:
                size = count * numpy.dtype(dtype).itemsize
            data = self._fh.read(size)
            return numpy.fromstring(data, dtype, count, sep)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号