我有一个包含495行URL的列的数据框。我想在jupyter笔记本中将这些URL显示为图像网格。此处显示数据帧的第一行。任何帮助表示赞赏。
id latitude longitude owner title url
23969985288 37.721238 -123.071023 7679729@N07 There she blows! https://farm5.staticflickr.com/4491/2396998528...
Run Code Online (Sandbox Code Playgroud)
我尝试了以下方法,
from IPython.core.display import display, HTML
for index, row in data1.iterrows():
display(HTML("<img src='%s'>"%(i["url"])))
Run Code Online (Sandbox Code Playgroud)
但是,运行上述代码会显示消息
> TypeError Traceback (most recent call last)
<ipython-input-117-4c2081563c17> in <module>()
1 from IPython.core.display import display, HTML
2 for index, row in data1.iterrows():
----> 3 display(HTML("<img src='%s'>"%(i["url"])))
TypeError: string indices must be integers
Run Code Online (Sandbox Code Playgroud)