【发布时间】:2020-11-22 15:00:54
【问题描述】:
我想从 python 中的图像中读取单独的表格。我有 10 张图片 (b1,b2,b3....b10) 有 8 个波段,我必须在其中执行此功能
b1 = rasterio.open('B1.tif')
b2 = rasterio.open('B2.tif')
b3 = rasterio.open('B3.tif')
...
b10 = rasterio.open('B10.tif')
我只用一个循环和更新就开始尝试这个。但是出现了这个错误
b1 = rasterio.open('B1.tif')
for i in range(1,8):
b1_(i) = b1.read(i)
File "<ipython-input-4-c7fe8df05d17>", line 3
b1_(i) = b1.read(i)
^
SyntaxError: cannot assign to function call
【问题讨论】:
-
欢迎来到 SO。你试过什么?将您的代码和任何错误/输出添加到您的问题中,这将帮助其他人找到解决您问题的方法。阅读SO guide to asking a question可能对您有所帮助。