<jupyter_start><jupyter_text>Summer Olympics Data Analysis Assignment<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
 

df = pd.read_csv("summer.csv")
df.head()
df.tail()
df.info()
df.describe()<jupyter_output><empty_output><jupyter_text>In how many cities Summer Olympics is held so far? 2. Which sport is having most number of Gold Medals so far? (Top 5)<jupyter_code>print("Summer olympics is held in",len(df['City'].unique()),"cities.")
data = []
for City in df['City'].unique():
    data.append([City , len(df[df['City']  == City])])
pd.DataFrame(data,columns = ['City','freq']).sort_values(by='freq', ascending=False)<jupyter_output><empty_output><jupyter_text>Which sport is having most number of medals so far?(Top5)<jupyter_code>df_gold = df[df['Medal'] == 'Gold']

df_gold.groupby('Sport').count()['Medal'].sort_values(ascending = False).head().plot.bar(figsize = (9,9), color = 'Blue')<jupyter_output><empty_output><jupyter_text>. Which sport is having most number of medals so far? (Top 5)<jupyter_code>df.groupby('Sport').count()['Medal'].head().sort_values(ascending = False).plot.bar(figsize = (10,10), color='Red')<jupyter_output><empty_output><jupyter_text>Which player has won most number of medals? (Top 5)<jupyter_code>df.groupby('Athlete').count()['Medal'].head().sort_values(ascending = False).plot.bar(figsize = (10,10), color = 'pink')<jupyter_output><empty_output><jupyter_text>Which player has won most number Gold Medals of medals? (Top 5)<jupyter_code>df_gold = df[df['Medal'] == 'Gold']

df_gold.groupby('Athlete').count()['Medal'].sort_values(ascending = False).head().plot.bar(figsize = (10,10), color='skyBlue')<jupyter_output><empty_output><jupyter_text>In which year India won first Gold Medal in Summer Olympics?<jupyter_code>df_india = df[df['Country'] == 'IND']
df_gold = df_india[df_india['Medal'] == 'Gold']
df_gold.groupby('Year').count()['Medal'].head(1).plot.bar(figsize = (3,3),color = 'Black')<jupyter_output><empty_output><jupyter_text>Which event is most popular in terms on number of players? (Top 5)<jupyter_code>df.groupby('Event').count()['Athlete'].head().sort_values(ascending = False).plot.bar(figsize = (10,10), color = 'yellow')<jupyter_output><empty_output><jupyter_text>Which sport is having most female Gold Medalists? (Top 5)<jupyter_code>df_women = df[df['Gender'] == 'Women']
df_gold = df_women[df_women['Medal'] == 'Gold']

df_gold.groupby('Sport').count()['Medal'].sort_values(ascending = False).head().plot.bar(figsize = (10,10), color = 'Brown')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1796662786185487, 'fraction_numerical': 0.012805587892898719, 'mean_word_length': 8.306859205776174, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '554185', 'license': 'Apache-2.0', 'n_tokens_mistral': 965, 'n_tokens_neox': 916, 'n_words': 174, 'path': 'summer (1).ipynb', 'repo_name': 'DaminiRaut/Skill-India-AI-ML-Scholarship', 'size': '2577'}