logo
Loading...

出現not all arguments converted during string formatting錯誤 - Cupoy

一開始,題目要求我們選出三個column判斷為何容易有例外數值。並要我們將其data_type填入d...

ml100-4

出現not all arguments converted during string formatting錯誤

2020/03/26 上午 02:12
機器學習共學討論版
James Yu
觀看數:8
回答數:2
收藏數:0
ml100-4

一開始,題目要求我們選出三個column判斷為何容易有例外數值。

並要我們將其data_type填入dtype_select = []中

但無論float或是column名字都會產生

not all arguments converted during string formatting

的error

回答列表

  • 2020/03/26 下午 08:47
    Jeffrey
    贊同數:0
    不贊同數:0
    留言數:1

    Hi, 你好,

    方便提供整段程式碼?

    或是, 先使用.format() ; 

    "'{0}' is longer than '{1}'".format(name1, name2)

  • 2020/03/27 上午 01:23
    張維元 (WeiYuan)
    贊同數:0
    不贊同數:0
    留言數:0

    嗨,


    你應該要提供「程式碼」及「產生錯誤的訊息」,這樣其他人比較容易給意見,不然我們可能要一行一行看...。這邊可以看到結果應該是這裡:


    ```

    print("Numbers of remain columns" % len(numeric_columns)) 

    ```


    左邊應該加上一個 %s:


    ```

    print("Numbers of remain columns %s" % len(numeric_columns)) 

    ```


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