<jupyter_start><jupyter_text>Sport Analytics<jupyter_code>import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import os
os.chdir(r'C:\Users\<NAME>\Python codes SSPU\Data sets')
df = pd.read_csv('yds_data.csv')
df.head(12500)
df.shape
df.isna().sum()
#how many goals are score and how many are not scored  print the count?
df['is_goal'].value_counts()
##top 10  missing values features name?
x = df.isna().sum()
x.sort_values(ascending=False).head(10)

#mention the years seasons ronaldo played each entry also ? 
#convert game_season      into categorical column?
df.head(5)
df['game_season'].unique()
df['game_season'] = df['game_season'].replace({'2000-01':'1', np.nan:'NONE', '2001-02':'2', '2002-03':'3', '2003-04':'4', '2004-05':'5',
       '2005-06':'6', '2006-07':'7', '2007-08':'8', '2008-09':'9', '2009-10':'10', '2010-11':'11',
       '2011-12':'12', '2012-13':'13', '2013-14':'14', '2014-15':'15th', '2015-16':'16th', '1996-97':'17th',
       '1997-98':'18th', '1998-99':'19th', '1999-00':'20th'})
df.head(12000)
#how many unique categories avail in game_season feature?

#after unique categories into something logical and numerical? 
#fill missing value in location_x and location_y
df['location_x'] = df['location_x'].replace( np.nan,0)
df['location_y'] = df['location_y'].replace( np.nan,0)
print(df['location_x'].isnull().sum(),'\t\t',df['location_y'].isnull().sum())

#tell shot which cristano scored most  number of goals?

df['shot_basics'].unique()
#Display the names of all columns
df.columns

# for which team most number of season cristanoo played?
df['team_name'].value_counts()
#How many penalty cristano  scored?
#power of shot fill missing value by mean

df['power_of_shot'] = df['power_of_shot'].fillna(df['power_of_shot'].mean())<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18808091853471842, 'fraction_numerical': 0.09185347184253691, 'mean_word_length': 5.879699248120301, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '55138', 'license': 'Apache-2.0', 'n_tokens_mistral': 779, 'n_tokens_neox': 653, 'n_words': 163, 'path': 'ML_Traning_Assignment/G_class_25_02_2021.ipynb', 'repo_name': 'adsulshyam0000/Machine-Learning-Projects-code', 'size': '1834'}