logo
Loading...

執行ecdf出現AttributeError: 'numpy.ndarray' object has no attribute 'index'錯誤 - Cupoy

先寫了ecdf=np.sort(app_train['AMT_INCOME_TOTAL'])cdf=...

執行ecdf出現AttributeError: 'numpy.ndarray' object has no attribute 'index'錯誤

2020/03/07 上午 10:14
機器學習共學討論版
Morgan Lin
觀看數:35
回答數:1
收藏數:0

先寫了ecdf=np.sort(app_train['AMT_INCOME_TOTAL'])

cdf=ecdf.index()

卻跑不出來

出現這個

AttributeError: 'numpy.ndarray' object has no attribute 'index'

該如何解決呢

回答列表

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

    嗨,


    這邊可以先解釋一下你這兩行想要做什麼嗎?


    ```

    ecdf=np.sort(app_train['AMT_INCOME_TOTAL'])

    cdf=ecdf.index()

    ```


    取 index 的方式應該是 .index 不是 .index()


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