Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Introduction

The data set we have taken from the cric-info website showing Pakistan team’s t20 stats.
We have following variables in the data set:

Result Margin Toss Bat Opposition Ground Start Date


Lost/won/no- By how Won/loss 1st/2nd Opposition Playing When
result many team Ground match
wickets or started
we have
won or
loss

Histogram
Code:
Library: import matplotlib.pyplot as plt
plt.hist(df['Result'], bins=5) # Adjust the number of bins as needed
plt.xlabel('Result')
plt.ylabel('Numbers')
plt.title('Histogram')
plt.show()

Output:
Pie chart
Code:
Libraries: import pandas as pd
import matplotlib.pyplot as plt
categories=['Won','Lost','Tied','N/R']
values1 = df['Won'].sum()
values2 = df['Lost'].sum()
values3 = df['Tied'].sum()
values4 = df['NR'].sum()
values = [values1, values2, values3, values4]
plt.pie(values, labels=categories, autopct='%1.1f%%')
plt.title('Pie Chart')
plt.show()

Output:

You might also like