logo
Loading...

vars= [x for x in list(plot_data.columns) if x != 'index'])程式意思 - Cupoy

想問這裡的vars= [x for x in list(plot_data.columns) if ...

vars= [x for x in list(plot_data.columns) if x != 'index'])程式意思

2020/03/25 下午 04:53
機器學習共學討論版
Morgan Lin
觀看數:10
回答數:1
收藏數:2

想問這裡的vars= [x for x in list(plot_data.columns) if x != 'index'])代表什麼意思

回答列表

  • 2020/03/26 上午 00:13
    張維元 (WeiYuan)
    贊同數:0
    不贊同數:0
    留言數:1

    這個寫法會等於以下:


    ```

    vars= []

    for x in list(plot_data.columns):

        if x != 'index':

            vars.append(x)

    ```


    這樣寫會看得懂嗎?


    如果這個回答對你有幫助請主動點選「有幫助」的按鈕,也可以追蹤我的GITHUB帳號。若還有問題的話,也歡迎繼續再追問或者把你理解的部分整理上來,我都會提供你 Review 和 Feedback 😃😃😃