logo
Loading...

為何需要使用unique - Cupoy

year_group_sorted = np.sort(age_data['YEARS_BINNED...

ml100-2,ml100-2-d11

為何需要使用unique

2019/05/15 上午 09:19
機器學習共學討論版
蔡家倫
觀看數:18
回答數:1
收藏數:0
ml100-2
ml100-2-d11

year_group_sorted = np.sort(age_data['YEARS_BINNED'].unique())

不懂這裡為甚麼要用unique


還有print出來為甚麼市長以下這個樣子

[Interval(20.0, 25.0, closed='right') Interval(25.0, 30.0, closed='right')
Interval(30.0, 35.0, closed='right') Interval(35.0, 40.0, closed='right')
Interval(40.0, 45.0, closed='right') Interval(45.0, 50.0, closed='right')
Interval(50.0, 55.0, closed='right') Interval(55.0, 60.0, closed='right')
Interval(60.0, 65.0, closed='right') Interval(65.0, 70.0, closed='right')]

謝謝

回答列表

  • 2019/05/15 下午 10:10
    Seanyu.TW
    贊同數:0
    不贊同數:0
    留言數:0

    Hi, 

    1. 因為不加上 unique 的話,會把一堆一樣的東西堆疊起來。

    2.  因為前面用 cut 處理過,所以他現在是個代表切分區間的東西。