text_html_output_1.png
import matplotlib.pyplot as plt

import pandas as ps

import seaborn as sn

import pandas as ps
import matplotlib.pyplot as plt
import seaborn as sn
from pandas_profiling import ProfileReport
winners_raw = ps.read_csv('/kaggle/input/nobel-prize-winners-19002020/nobel_prize_by_winner.csv')

winners_raw.dtypes

winners_raw.shape

winners_raw.isnull().sum()

winners = winners_raw.drop(columns=['id', 'died', 'bornCity', 'bornCountry', 'diedCountry', 'diedCountryCode', 'diedCity', 'motivation', 'overallMotivation', 'name', 'city', 'country'], axis=1)

winners1 = winners.dropna(subset=['year', 'share', 'category'])
winners1.shape

dtype_converter = {'firstname': str, 'surname': str, 'share': int, 'year': int, 'gender': str}
winners1 = winners1.astype(dtype_converter)

alive = winners1.loc[winners_raw['died'] == '0000-00-00']
category_dummies = ps.get_dummies(alive['category'])
category_dummies
gender_dummies = ps.get_dummies(alive['gender'])
gender_dummies

alive2 = ps.concat([alive, category_dummies, gender_dummies], axis=1)

CountryVsCat = alive2.groupby('bornCountryCode')['peace'].sum()

CountryVsCat = alive2.groupby('bornCountryCode')['chemistry'].sum()
plt.figure(figsize=(28, 11))
sn.barplot(x=CountryVsCat.index, y=CountryVsCat.values, palette='rainbow').set_title('Chemistry - Counts')