我试图使用api进行数据分析,从亚马逊将一些图像导入我的本地计算机
这是我的代码我收到此错误。不知道该怎么做请建议一些解决方案
代码
from PIL import Image
import requests
from io import BytesIO
for index, row in images.iterrows():
url = row['large_image_url']
response = requests.get(url)
img = Image.open(BytesIO(response.content))
img.save('images/15k_images/'+row['asin']+'.jpeg')
错误
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-36-ce8803db815e> in <module>() 9 from io import BytesIO 10 ---> 11 for index, row in images.iterrows(): 12 url = row['large_image_url'] 13 response = requests.get(url) NameError: name 'images' is not defined