<jupyter_start><jupyter_text>**Prerequisites for the Project****Simple numpy arrays:****1. Single Dimension Arrays****2. Multi Dimension Arrays**<jupyter_code>import numpy as np
#1D array
n1 =np.array([1, 2, 3, 4, 5])
n1
type(n1)
#2D array
n2 = np.array([[6, 3, 2, 9, 1],
              [7, 6, 8, 3, 2]])
n2
type(n2)<jupyter_output><empty_output><jupyter_text>**Zeros() of numpy is used:**<jupyter_code>n0= np.zeros((1,2))
n0
n0= np.zeros((6,6))
n0<jupyter_output><empty_output><jupyter_text>**Pandas Data Structures:****1. Single Dimensional :- Series Object (labled array)****2. Multi Dimensional :- Data-frame (labled table)**<jupyter_code>#pandas series
import pandas as pd
s1 = pd.Series([5, 12, 6 , 9, 32])
s1
type(s1)
#pandas data-frame
#D of Data & F of frame should be capital 
pd.DataFrame({"Reg No.":[101, 119, 115, 103, 165, 192],"Name":["Bob", "Sam", "Tina", "Ahaana", "Reet", "Preety"], "CGPA":[7.9, 6.2, 9.5, 8.8, 7.3, 9.0]})<jupyter_output><empty_output><jupyter_text>**Project 1**  **ReadMe:**<jupyter_code>#importing the required libraries
import pandas as pd  
from matplotlib import pyplot as plt
import seaborn as sns
#For taking the dataset from G-drive
from google.colab import drive #mounting my G-drive to G-colab
drive.mount('/content/drive')

#For taking the dataset from device
#from google.colab import files
#uploaded = files.upload()
#Reading the data from the G-drive and directly assigning it to a pandas data frame
fd=pd.read_csv("/content/drive/MyDrive/Learning..../Python/Project Final Copy/FIFAdata.csv")

#import io
#df2 = pd.read_csv(io.BytesIO(uploaded['FIFAdata.csv']))
#This stores the Dataset in a Pandas Dataframe
#fd = pd.read_csv("FIFAdata.csv")
fd.head() #head() gives us the first 5 records by default
#to view more than 5 records simply specify the number within the parenthesis as follows:
fd.head(10) #this gives us the first/ top 10 records
for col in fd.columns:
  print(col) #printig out all the columns with thier header names!
fd.shape #shape to see how many rows and cols are there in my FIFAdata.csv
#18278 number of players and 104 columns of details
body= fd[["height_cm", "weight_kg", "body_type"]]
body.value_counts()

fd["nationality"].value_counts() #it gives distinct countries (nationality wise) with the corresponding number of players they have
fd["nationality"].value_counts()[0:10]
#if i want to view the top 10 countries 
fd["age"].value_counts()[0:5]
#This displays the number of players of top 5 youngest age groups
fd["nationality"].value_counts()[0:5].keys()
#number of players belonging to different nationality
plt.figure(figsize=(7,7))
plt.bar(list(fd["nationality"].value_counts()[0:5].keys()), list(fd["nationality"].value_counts()[0:5]), color="y")
#displaying a bar graph of the number of players with different specific player traits
plt.figure(figsize=(20,10))
plt.bar(list(fd["player_traits"].value_counts()[0:10].keys()), list(fd["player_traits"].value_counts()[0:10]), color="orange")

#displaying a bar graph of the number of players with best headAccuracy
plt.figure(figsize=(20,10))
plt.bar(list(fd["nation_position"].value_counts()[0:10].keys()), list(fd["nation_position"].value_counts()[0:10]), color="blue")
salary = fd[["short_name", "wage_eur"]]
salary.head(20) #shows the first 20 records of players with their income in Euros
#sorting the players according to their wage/ income
player_salary = salary.sort_values(by=["wage_eur"], ascending=False)
player_salary.head(10) #it displays the top 10 highest paid players
plt.figure(figsize=(20,10))
plt.bar(list(player_salary['short_name'])[0:10],list(player_salary['wage_eur'])[0:10],color="purple")
plt.show() #just the graphical representation of the top 10 highest paid players
#exactly the same thing just changing the color of individual columns
plt.figure(figsize=(20,10))
plt.bar(list(player_salary['short_name'])[0:10],list(player_salary['wage_eur'])[0:10],color=["purple", "indigo", "navy", "blue","green","yellow","pink", "violet", "brown", "darkred"])
#["purple", "indigo","blue","green","olive","yellow", "orange", "brown", "red", "marron"]
plt.show() #just the graphical representation of the top 10 highest paid players
#Checking if a player is from Germany or not
fd["nationality"] == "Germany"
#Displaying the first 10 players from Germany
G= fd[fd["nationality"] == "Germany"]
G.head(10)
G.sort_values(by=["height_cm"], ascending=False).head()
#displaying the top 5 tall german players
G.sort_values(by=["weight_kg"], ascending=False).head()
#displaying the top 5 massive german players
G.sort_values(by=["wage_eur"], ascending=False).head()
#displaying the top 5 highest paid german players
Germany=G[["short_name", "wage_eur"]].sort_values(by=["wage_eur"],ascending=False).head(10)
Germany #storing the output in Germany
#displaying the highest paid german players

#Or else simply writing the following will execute the same:
#G[["short_name", "wage_eur"]].sort_values(by=["wage_eur"],ascending=False).head(10)

plt.figure(figsize=(20,10))
plt.bar(list(Germany['short_name']),list(Germany['wage_eur']),color="brown") #Since we are using Germany here which already has all the information in it
plt.show() #just the graphical representation of the top 10 highest paid German players

#Shooting
shoot=fd[["short_name", "shooting"]].sort_values(by=["shooting"], ascending=False).head(10)
shoot #showing first 10 best shooters

#Alternatively use fd[["short_name", "shooting"]].sort_values(by=["shooting"], ascending=False).head(10)
plt.figure(figsize=(20,10))
plt.bar(list(shoot['short_name']),list(shoot['shooting']),color="navy") #Since we are using Germany here which already has all the information in it
plt.show()
#Head Accuracy
headAccuracy= fd[["short_name","attacking_heading_accuracy"]].sort_values(by=["attacking_heading_accuracy"], ascending= False).head(10)
headAccuracy

#displayig the top 10 players with the best headAccuracy
plt.figure(figsize=(20,10))
plt.bar(list(headAccuracy['short_name']),list(headAccuracy['attacking_heading_accuracy']),color="green")
plt.show() #just a graphical representation of the top 10 players with the best headAccuracy
#Defending
defend= fd[["short_name", "defending", "nationality", "club"]].sort_values(by=["defending"], ascending=False)
defend.head(10) #top 10 players with the best defending skills
plt.figure(figsize=(20,10))
plt.bar(list(defend['short_name'])[0:10],list(defend['defending'])[0:10],color="red")
plt.show() #just a graphical representation of the top 10 players with the best defending skills
#see for RealMadraid Players
madyPlayers= fd[fd["club"]=="Real Madrid"]
madyPlayers #displaying all the RealMadraid Players
RMwage= madyPlayers.sort_values(by=["wage_eur"], ascending= False)
RMwage.head()
#displaying the top 5 highest paid RealMadraid Players 
plt.figure(figsize=(15,10))
plt.bar(list(RMwage['short_name'])[0:10],list(RMwage['wage_eur'])[0:10],color="olive")
plt.show() #displaying the top 5 highest paid RealMadraid Players in bar-graph
RMshoot= madyPlayers.sort_values(by=["shooting"], ascending= False)
RMshoot.head()
#displaying the top 5 best shooters among RealMadraid Players 
plt.figure(figsize=(15,10))
plt.bar(list(RMshoot['short_name'])[0:10],list(RMshoot['shooting'])[0:10],color="lime")
plt.show()
RMdef= madyPlayers.sort_values(by=["defending"], ascending= False)
RMdef.head()
#displaying the top 5 best defenders among RealMadraid Players 
plt.figure(figsize=(15,10))
plt.bar(list(RMdef['short_name'])[0:10],list(RMdef['defending'])[0:10],color="seagreen")
plt.show()
real_madrid=fd[fd['club']=='Real Madrid']
real_madrid['nationality'].value_counts()
#number of real_madrid players belonging to different nationality
plt.figure(figsize=(15,10))
plt.bar(list(real_madrid["nationality"].value_counts()[0:10].keys()), list(real_madrid["nationality"].value_counts()[0:10]), color="gold")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15758037870123268, 'fraction_numerical': 0.03253272334477062, 'mean_word_length': 7.696132596685083, 'pattern_counts': {'":': 3, '<': 17, '<?xml version=': 0, '>': 17, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '191532', 'license': 'MIT', 'n_tokens_mistral': 2891, 'n_tokens_neox': 2619, 'n_words': 720, 'path': 'Foundational/FootballDataAnalysis.ipynb', 'repo_name': 'Kristina140699/CProgrammingCodes', 'size': '7869'}