【发布时间】:2018-05-10 12:41:05
【问题描述】:
我有一个包含 495 行 URL 的列的数据框。我想在 jupyter notebook 中将这些 URL 显示为图像网格。数据框的第一行显示在这里。任何帮助表示赞赏。
id latitude longitude owner title url
23969985288 37.721238 -123.071023 7679729@N07 There she blows! https://farm5.staticflickr.com/4491/2396998528...
我试过以下方法,
from IPython.core.display import display, HTML
for index, row in data1.iterrows():
display(HTML("<img src='%s'>"%(i["url"])))
但是,运行上述代码会显示消息
> 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
【问题讨论】:
-
请添加一些代码来显示您已经尝试过的内容。
-
嗨,我已经添加了一些细节
标签: python html matplotlib jupyter-notebook