logo
Loading...

無法讀取圖片 - Cupoy

result = img2arr_fromURLs(df[0:5][1].values)print(...

ml100-3,ml100-3-d05

無法讀取圖片

2019/09/14 上午 11:59
機器學習共學討論版
朱武勳
觀看數:56
回答數:2
收藏數:0
ml100-3
ml100-3-d05

result = img2arr_fromURLs(df[0:5][1].values)

print("Total images that we got: %i " % len(result))


for im_get in result:

   plt.imshow(im_get)

plt.show()

回答列表

  • 2019/09/14 下午 11:39
    Wei-po Tsai
    贊同數:0
    不贊同數:0
    留言數:2

    Hi!同學你好:

    ============================================

    我是偽菠菜(Wei-Po Tsai),是個剛學Python的新手,

    對你提到的問題很有興趣,所以研究了一下,請多指教。

    ============================================

    在這邊會出現error,主要有幾個問題喔:


    1. 索引方式不對,DataFrame建議使用loc或iloc進行索引。


    2. for語句的循環當中,縮排(空格數)不對。


    如下圖紅框處:


    修正以後,就會正常顯示圖片囉,請再試試看吧!

    Edited By:偽菠菜(Wei-Po Tsai)

  • 2019/09/15 上午 01:56
    張維元 (WeiYuan)
    贊同數:0
    不贊同數:1
    留言數:0

    無法成功的原因是什麼?是有錯誤嗎?還是沒有東西跑出來?下次再問題的時候記得要補充多一點資訊