Big Data 11 min read

Uncovering Nobel Prize Trends: Gender, Country, and Age Insights with Python

This article presents a comprehensive Python-driven analysis of Nobel Prize laureates, examining gender distribution, top awarding countries across each prize category, proportional representation among fields, and average age of winners, accompanied by visualizations generated from the underlying datasets.

Python Crawling & Data Mining
Python Crawling & Data Mining
Python Crawling & Data Mining
Uncovering Nobel Prize Trends: Gender, Country, and Age Insights with Python

Recently, Nobel laureates have sparked discussion; I performed a data analysis of historical Nobel Prize winners and share the findings.

Nobel Prize (Swedish: Nobelpriset, English: Nobel Prize) refers to the five awards established by Alfred Nobel's 1895 will, including Physics , Chemistry , Peace , Physiology or Medicine , and Literature . An additional Economic Sciences prize was created by the Swedish Central Bank in 1968. The Nobel Prizes honor outstanding contributions to society in these fields.

1. Import Data

#获取获奖信息数据
import pandas as

data_date   = pd.read_csv('nobel_prizes_by_date.csv',encoding = 'ISO-8859-1')
data_winner = pd.read_csv('nobel_prize_by_winner.csv',encoding = 'ISO-8859-1')
data_winner.head()

2. Gender Distribution Statistics

#去重后获奖者总人数

data.id.nunique()

Output: 901

def make_autopct(values):
    def my_autopct(pct):
        total = sum(values)
        val = int(round(pct*total/100.0))
        # 同时显示数值和占比的饼图
        return '{p:.2f}%  ({v:d}人)'.format(p=pct,v=val)
    return my_autopct

# 长8英寸 宽6英寸,该窗口的分辨率为80
plt.figure(figsize=(8,6), dpi=80)

labels = '男','女','组织'
explode = (0,0,0)  # 将某一块分割出来,值越大分割出的间隙越大
colors = ['yellowgreen','lightskyblue','yellow']

patches,text1,text2 = plt.pie([male,female,org],
                              explode=explode,
                              labels=labels,
                              colors=colors,
                              labeldistance = 1.1,
                              autopct = make_autopct([male,female,org]),
                              shadow = True,
                              startangle = 30,
                              pctdistance = 0.7)
plt.title('获奖者男女比例',fontsize=19)
plt.legend()
plt.show()

3. Country-wise Award Statistics

#实例化Pie类
pie = Pie(init_opts=opts.InitOpts(width='800px',height='550px'))

#添加数据,设置饼图半径
pie.add('',[list(z) for z in zip(data_cou.head(15).index.tolist(), data_cou.head(15).values.tolist())],
        radius=['40%','65%'],
        rosetype='radius')
pie.set_global_opts(title_opts=opts.TitleOpts(title=''),
                   legend_opts=opts.LegendOpts(is_show=True))
pie.render_notebook()

4. Field-wise Award Proportion Statistics

# 长16英寸 宽8英寸,该窗口的分辨率为80
plt.figure(figsize=(16,8), dpi=80)

def make_autopct(values):
    def my_autopct(pct):
        total = sum(values)
        val = int(round(pct*total/100.0))
        return '{p:.2f}%  ({v:d}人)'.format(p=pct,v=val)
    return my_autopct

patches,l_text,p_text = plt.pie(data_cate.values,
                                 labeldistance = 1.1,
                                 labels=data_cate.index,
                                 startangle = 60,
                                 pctdistance = 0.7,
                                 autopct=make_autopct(data_cate.values))
for t in l_text:
    t.set_size(12)
for t in p_text:
    t.set_size(12)
plt.title('各领域获奖人数',fontsize=15)
plt.legend(loc=2)
plt.show()

5. Top 10 Countries per Award Category

1. Physiology or Medicine

#实例化Pie类
pie = Pie(init_opts=opts.InitOpts(width='800px',height='550px'))
pie.add('',[list(z) for z in zip(data_med.head(10).index.tolist(), data_med.head(10).values.tolist())],
        radius=['30%','60%'],
        rosetype='radius')
pie.set_global_opts(title_opts=opts.TitleOpts(title=''),
                   legend_opts=opts.LegendOpts(is_show=True))
pie.render_notebook()

2. Physics

#实例化Pie类
pie = Pie(init_opts=opts.InitOpts(width='800px',height='550px'))
pie.add('',[list(z) for z in zip(data_phy.head(10).index.tolist(), data_phy.head(10).values.tolist())],
        radius=['30%','60%'],
        rosetype='radius')
pie.set_global_opts(title_opts=opts.TitleOpts(title=''),
                   legend_opts=opts.LegendOpts(is_show=True))
pie.render_notebook()

3. Chemistry

#实例化Pie类
pie = Pie(init_opts=opts.InitOpts(width='800px',height='550px'))
pie.add('',[list(z) for z in zip(data_che.head(10).index.tolist(), data_che.head(10).values.tolist())],
        radius=['30%','60%'],
        rosetype='radius')
pie.set_global_opts(title_opts=opts.TitleOpts(title=''),
                   legend_opts=opts.LegendOpts(is_show=True))
pie.render_notebook()

4. Literature

#实例化Pie类
pie = Pie(init_opts=opts.InitOpts(width='800px',height='550px'))
pie.add('',[list(z) for z in zip(data_lit.head(10).index.tolist(), data_lit.head(10).values.tolist())],
        radius=['30%','60%'],
        rosetype='radius')
pie.set_global_opts(title_opts=opts.TitleOpts(title=''),
                   legend_opts=opts.LegendOpts(is_show=True))
pie.render_notebook()

5. Economic Sciences

#实例化Pie类
pie = Pie(init_opts=opts.InitOpts(width='800px',height='550px'))
pie.add('',[list(z) for z in zip(data_eco.head(10).index.tolist(), data_eco.head(10).values.tolist())],
        radius=['45%','75%'],
        rosetype='radius')
pie.set_global_opts(title_opts=opts.TitleOpts(title=''),
                   legend_opts=opts.LegendOpts(is_show=True))
pie.render_notebook()

6. Peace

#实例化Pie类
pie = Pie(init_opts=opts.InitOpts(width='800px',height='550px'))
pie.add('',[list(z) for z in zip(data_pea.head(10).index.tolist(), data_pea.head(10).values.tolist())],
        radius=['30%','60%'],
        rosetype='radius')
pie.set_global_opts(title_opts=opts.TitleOpts(title=''),
                   legend_opts=opts.LegendOpts(is_show=True))
pie.render_notebook()

6. Average Age of Laureates

df.plot(kind='bar',figsize=(10,6))

plt.title('各领域获奖者获奖年龄分布',fontsize=17)
plt.ylabel('获奖年龄',fontsize=14)
plt.xlabel('获奖领域',fontsize=14)
plt.xticks(rotation=45,fontsize=14)

plt.legend(loc=9,bbox_to_anchor=(0.86,0.96))

This article is intended solely for code learning and sharing; please do not overuse web scraping.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

statisticsNobel Prize
Python Crawling & Data Mining
Written by

Python Crawling & Data Mining

Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.