Youtube Video commentary is also available.
P-018: Sort the customer data frame (df_customer) by date of birth (birth_day) in ascending order, and display all the first 10 items.
code
df_customer.sort_values('birth_day', ascending=False).head(10)
customer_id | customer_name | gender_cd | gender | birth_day | age | postal_cd | address | application_store_cd | application_date | status_cd | |
---|---|---|---|---|---|---|---|---|---|---|---|
15639 | CS035114000004 | Misato Omura | 1 | Female | 2007-11-25 | 11 | 156-0053 | Sakura, Setagaya-ku, Tokyo********** | S13035 | 20150619 | 6-20091205-6 |
7468 | CS022103000002 | Fukuyama Hajime | 9 | unknown | 2007-10-02 | 11 | 249-0006 | Zushi, Zushi City, Kanagawa Prefecture********** | S14022 | 20160909 | 0-00000000-0 |
10745 | CS002113000009 | Mayuko Shibata | 1 | Female | 2007-09-17 | 11 | 184-0014 | Nukuiminami-cho, Koganei-shi, Tokyo********** | S13002 | 20160304 | 0-00000000-0 |
19811 | CS004115000014 | Kyoko Matsui | 1 | Female | 2007-08-09 | 11 | 165-0031 | Kamisaginomiya, Nakano-ku, Tokyo********** | S13004 | 20161120 | 1-20081231-1 |
7039 | CS002114000010 | Haruka Yamauchi | 1 | Female | 2007-06-03 | 11 | 184-0015 | Nukui Kitamachi, Koganei City, Tokyo********** | S13002 | 20160920 | 6-20100510-1 |
3670 | CS025115000002 | Natsuki Koyanagi | 1 | Female | 2007-04-18 | 11 | 245-0018 | Kamiiida-cho, Izumi-ku, Yokohama-shi, Kanagawa********** | S14025 | 20160116 | D-20100913-D |
12493 | CS002113000025 | Hirosue Manami | 1 | Female | 2007-03-30 | 12 | 184-0015 | Nukui Kitamachi, Koganei City, Tokyo********** | S13002 | 20171030 | 0-00000000-0 |
15977 | CS033112000003 | Miki Nagano | 1 | Female | 2007-03-22 | 12 | 245-0051 | Nase-cho, Totsuka-ku, Yokohama-shi, Kanagawa********** | S14033 | 20150606 | 0-00000000-0 |
5716 | CS007115000006 | Fukuoka Shun | 1 | Female | 2007-03-10 | 12 | 285-0845 | Nishishizu, Sakura City, Chiba Prefecture********** | S12007 | 20151118 | F-20101016-F |
15097 | CS014113000008 | Rio Yaguchi | 1 | Female | 2007-03-05 | 12 | 260-0041 | Higashichiba, Chuo-ku, Chiba City, Chiba Prefecture********** | S12014 | 20150622 | 3-20091108-6 |
** ・ It is a method to sort data in Pandas DataFrame / Series.
-Use when you want to sort the information in ascending or descending order.
-'Sort_values (
Recommended Posts