DataSet:
- First open Ms Excel
- Declare Field name and Data
- Next save excel file"cricketsports.csv"
- its need save only comma delimiter(CSV) File
Folder Path:
- First create project folder cricket
- folder inside create folder "Match"(Its a function folder)
Program Code:
Folder cricket->cricket.py
import match
from match.teamA import*
match.teamA.teamAScore()
match.teamA.teamAattendbat()
match.teamA.teamAattendball()
Folder cricket->match->teamA.py
def teamAScore():
import pandas as pd
df=pd.read_csv("cricketsports.csv")
x=df["Team A "].sum()
y=120
print("Team A Score:",int(x))
def teamAattendbat():
import pandas as pd
df=pd.read_csv("cricketsports.csv")
from sklearn.metrics import accuracy_score
batattend=df["batattend"]
batA=df["batA"]
print('Bating Accuracy:',accuracy_score(batattend,batA))
def teamAattendball():
import pandas as pd
df=pd.read_csv("cricketsports.csv")
ballA=df["balla"].count()
print('Ball Accuracy:120 ball/',ballA,"ball")
Output:
Code & Concept Copyrights@Saravanakumar from psktechnology
Comments
Post a Comment