Skip to main content

Cricket Score analytics Using Python


DataSet:

  1. First open Ms Excel
  2. Declare Field name and Data
  3. Next save excel file"cricketsports.csv"
  4. its need save only comma delimiter(CSV) File

Folder Path:

  1. First create project folder cricket
  2. 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

Popular posts from this blog

SK Political Analytics-About us

புலவர் பழனிசாமி (மாவட்ட இலக்கிய அணி செயலாளர்) HOME            ABOUT US         OUR WORK        IMPACT

SK Political Analytics-Home

புலவர் பழனிசாமி (மாவட்ட இலக்கிய அணி செயலாளர்) HOME          ABOUT  US       OUR WORK        IMPACT

Swift UI Design

  // //  ContentView.swift //  test // //  Created by saravana kumar on 18/10/23. // import SwiftUI import CoreData struct ContentView : View {     @State private var selectedValue = "One"        let counts = [ "One" , "Two" , "Three" ]     var body : some View {       List () {                  HStack         {         Text ( "Add Paln" )                 . foregroundColor ( Color . gray )                 . font (. system ( size : 36 ))             Spacer ()         Image ( systemName : "xmark" )                 . foregroundColor ( Color . red )                     } ...