<jupyter_start><jupyter_text>IPL Dataset Analysis Problem StatementWe want to know as to what happens during an IPL match which raises several questions in our mind with our limited knowledge about the game called cricket on which it is based. This analysis is done to know as which factors led one of the team to win and how does it matter.  About the Dataset :The Indian Premier League (IPL) is a professional T20 cricket league in India contested during April-May of every year by teams representing Indian cities. It is the most-attended cricket league in the world and ranks sixth among all the sports leagues. It has teams with players from around the world and is very competitive and entertaining with a lot of close matches between teams.The IPL and other cricket related datasets are available at [cricsheet.org](https://cricsheet.org/%c2%a0(data). Feel free to visit the website and explore the data by yourself as exploring new sources of data is one of the interesting activities a data scientist gets to do.  Analysing data with basic python operation  Read the data of the format .yaml type<jupyter_code>import yaml
import yaml
# using with open command to read the file
with open('/content/ipl_match.yaml') as f:
    data = yaml.load(f)
data<jupyter_output><empty_output><jupyter_text>Now let's find answers to some prilminary questions such as   Can you guess the data type with which your working on ?<jupyter_code>type(data)
data.get('info')<jupyter_output><empty_output><jupyter_text>In which city the match was played and where was it played ?<jupyter_code>print('The Match was played at: ',data.get('info').get('city'))

print('The venue for the match was: ', data.get('info').get('venue'))<jupyter_output>The Match was played at:  Bangalore
The venue for the match was:  M Chinnaswamy Stadium<jupyter_text>Which are all the teams that played in the tournament ? How many teams participated  in total?<jupyter_code>x = data.get('info').get('teams')

for i in range(len(x)):
  print('The teams participated are: ', x[i], end = " ")
  i+=1

print('\n The number of teams played are: ', len(x))<jupyter_output>The teams participated are:  Royal Challengers Bangalore The teams participated are:  Kolkata Knight Riders 
 The number of teams played are:  2<jupyter_text>Which team won the toss and what was the decision of toss winner ?<jupyter_code>y = data.get('info').get('toss')
print(y['winner'], 'won the toss')
print(y['winner'], 'decides to', y['decision'])<jupyter_output>Royal Challengers Bangalore won the toss
Royal Challengers Bangalore decides to field<jupyter_text>Find the first bowler who played the first ball of the first inning. Also the first batsman who faced first delivery ?<jupyter_code>x = data['innings'][0]

y = x['1st innings']

z = y['deliveries']

#print(z)

#print(type(z))

a = z[0]

#print(a)

b = a[0.1]

#print(b)

c = b['bowler']

print('The first ball was bowled by: ', c)

print('The first batsman who faced the delivery : ', b['batsman'])<jupyter_output><empty_output><jupyter_text>How many deliveries were delivered in first inning ?<jupyter_code>y = data.get('innings')

#print(y)

a = y[0]

#print(a)

b = a.get('1st innings')

#print(b)

c = b.get('deliveries')

print("There were {} deliveries bowled in 1 st innings ".format(len(c)))<jupyter_output>There were 124 deliveries bowled in 1 st innings<jupyter_text>How many deliveries were delivered in second inning ?<jupyter_code>#print(y[1])

z = y[1]

#print(z.get('2nd innings'))

d = z.get('2nd innings')

e = len(d.get('deliveries'))

print('There were {} ball were bowled in second innings'.format(e))<jupyter_output>There were 101 ball were bowled in second innings<jupyter_text>Which team won and how ?<jupyter_code>win = data.get('info').get('outcome')

#print(win)

print('{} won the game by {} runs'.format(win.get('winner'), win.get('by').get('runs')))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10524967989756723, 'fraction_numerical': 0.006402048655569782, 'mean_word_length': 5.4561983471074385, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 1, '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': '510114', 'license': 'MIT', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1218, 'n_words': 480, 'path': 'Python_Getting_Started_Code_Along_.ipynb', 'repo_name': 'dilip1906/dsmp-pre-work', 'size': '3905'}