Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,282 +1,170 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import pandas as pd
|
| 3 |
import requests
|
| 4 |
-
import
|
| 5 |
-
from PIL import Image
|
| 6 |
-
import io
|
| 7 |
import time
|
| 8 |
-
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
class
|
| 11 |
def __init__(self):
|
| 12 |
-
|
| 13 |
-
self.
|
| 14 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
"x-rapidapi-host": "cricbuzz-cricket.p.rapidapi.com"
|
| 16 |
}
|
| 17 |
|
| 18 |
-
def load_wide_csv(self, csv_path: str) -> pd.DataFrame:
|
| 19 |
-
"""Convert your wide-format CSV to the long format the app expects"""
|
| 20 |
try:
|
| 21 |
-
|
| 22 |
-
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
stat_name = col.split('_')[1] # Gets the stat name (Runs, Average, etc.)
|
| 34 |
-
batting_stats[stat_name] = row[col]
|
| 35 |
-
|
| 36 |
-
if any(pd.notna(val) for val in batting_stats.values()): # Only add if stats exist
|
| 37 |
-
long_df = pd.concat([
|
| 38 |
-
long_df,
|
| 39 |
-
pd.DataFrame([{
|
| 40 |
-
'Player': player_name,
|
| 41 |
-
'ID': f"{player_name}_{team}", # Create synthetic ID
|
| 42 |
-
'Type': 'batting',
|
| 43 |
-
'Format': fmt,
|
| 44 |
-
'Stats': str(batting_stats)
|
| 45 |
-
}])
|
| 46 |
-
], ignore_index=True)
|
| 47 |
|
| 48 |
-
# Process bowling stats
|
| 49 |
-
for fmt in ['Test', 'ODI', 'T20', 'IPL']:
|
| 50 |
-
bowling_stats = {}
|
| 51 |
-
for col in row.index:
|
| 52 |
-
if col.startswith('bowling_') and col.endswith(f'_{fmt}'):
|
| 53 |
-
stat_name = '_'.join(col.split('_')[1:-1]) # Gets the stat name
|
| 54 |
-
bowling_stats[stat_name] = row[col]
|
| 55 |
-
|
| 56 |
-
if any(pd.notna(val) for val in bowling_stats.values()): # Only add if stats exist
|
| 57 |
-
long_df = pd.concat([
|
| 58 |
-
long_df,
|
| 59 |
-
pd.DataFrame([{
|
| 60 |
-
'Player': player_name,
|
| 61 |
-
'ID': f"{player_name}_{team}", # Create synthetic ID
|
| 62 |
-
'Type': 'bowling',
|
| 63 |
-
'Format': fmt,
|
| 64 |
-
'Stats': str(bowling_stats)
|
| 65 |
-
}])
|
| 66 |
-
], ignore_index=True)
|
| 67 |
-
|
| 68 |
-
return long_df
|
| 69 |
-
|
| 70 |
except Exception as e:
|
| 71 |
-
|
| 72 |
-
return
|
| 73 |
-
|
| 74 |
-
def
|
| 75 |
-
"""Search for player
|
| 76 |
-
|
| 77 |
-
return st.session_state.local_db[
|
| 78 |
-
st.session_state.local_db['Player'].str.contains(player_name, case=False)
|
| 79 |
-
]
|
| 80 |
-
return pd.DataFrame()
|
| 81 |
-
|
| 82 |
-
def fetch_from_api(self, player_name: str) -> Optional[Dict]:
|
| 83 |
-
"""Fetch player data from API"""
|
| 84 |
-
search_url = "https://cricbuzz-cricket2.p.rapidapi.com/stats/v1/player/search"
|
| 85 |
params = {"plrN": player_name}
|
| 86 |
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
data = response.json()
|
| 91 |
-
if data.get('player'):
|
| 92 |
-
return data['player'][0]
|
| 93 |
-
except Exception as e:
|
| 94 |
-
st.error(f"API Error: {e}")
|
| 95 |
-
return None
|
| 96 |
-
|
| 97 |
-
def get_player_stats(self, player_id: str, stat_type: str = "batting") -> Optional[Dict]:
|
| 98 |
-
"""Get specific stats for a player"""
|
| 99 |
-
stats_url = f"https://cricbuzz-cricket.p.rapidapi.com/stats/v1/player/{player_id}/{stat_type}"
|
| 100 |
-
try:
|
| 101 |
-
response = requests.get(stats_url, headers=self.headers)
|
| 102 |
-
if response.status_code == 200:
|
| 103 |
-
return response.json()
|
| 104 |
-
except Exception as e:
|
| 105 |
-
st.error(f"Stats API Error: {e}")
|
| 106 |
return None
|
| 107 |
-
|
| 108 |
-
def
|
| 109 |
-
"""
|
| 110 |
-
|
| 111 |
-
stats_values = raw_stats.get('values', [])
|
| 112 |
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
processed[fmt] = {}
|
| 119 |
-
processed[fmt][category] = stat['values'][i]
|
| 120 |
-
return processed
|
| 121 |
-
|
| 122 |
-
def update_local_db(self, player_info: Dict, stats_data: Dict) -> bool:
|
| 123 |
-
"""Add new player data to local database"""
|
| 124 |
-
new_rows = []
|
| 125 |
-
for stat_type in ['batting', 'bowling']:
|
| 126 |
-
if stat_type in stats_data:
|
| 127 |
-
processed = self.process_stats(stats_data[stat_type])
|
| 128 |
-
for fmt, stats in processed.items():
|
| 129 |
-
new_rows.append({
|
| 130 |
-
'Player': player_info['name'],
|
| 131 |
-
'ID': player_info['id'],
|
| 132 |
-
'Type': stat_type,
|
| 133 |
-
'Format': fmt,
|
| 134 |
-
'Stats': str(stats)
|
| 135 |
-
})
|
| 136 |
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
def save_to_csv(self) -> None:
|
| 145 |
-
"""Save the current database to CSV"""
|
| 146 |
-
try:
|
| 147 |
-
st.session_state.local_db.to_csv('cricket_players_long_format.csv', index=False)
|
| 148 |
-
except Exception as e:
|
| 149 |
-
st.error(f"Error saving to CSV: {e}")
|
| 150 |
-
|
| 151 |
-
def display_stats(self, stats: Dict) -> None:
|
| 152 |
-
"""Display stats in Streamlit"""
|
| 153 |
-
for format_type, stats_dict in stats.items():
|
| 154 |
-
with st.expander(f"{format_type} Statistics"):
|
| 155 |
-
# Convert stats to dataframe
|
| 156 |
-
df = pd.DataFrame.from_dict(stats_dict, orient='index', columns=['Value'])
|
| 157 |
-
|
| 158 |
-
# Separate batting and bowling stats visually
|
| 159 |
-
batting_stats = {k:v for k,v in stats_dict.items() if not k.startswith('bowling_')}
|
| 160 |
-
bowling_stats = {k.replace('bowling_', ''):v
|
| 161 |
-
for k,v in stats_dict.items() if k.startswith('bowling_')}
|
| 162 |
-
|
| 163 |
-
if batting_stats:
|
| 164 |
-
st.write("#### Batting")
|
| 165 |
-
st.dataframe(pd.DataFrame.from_dict(batting_stats, orient='index', columns=['Value']))
|
| 166 |
-
|
| 167 |
-
if bowling_stats:
|
| 168 |
-
st.write("#### Bowling")
|
| 169 |
-
st.dataframe(pd.DataFrame.from_dict(bowling_stats, orient='index', columns=['Value']))
|
| 170 |
-
|
| 171 |
-
def get_player_image(self, image_url: str) -> None:
|
| 172 |
-
"""Fetch and display player image"""
|
| 173 |
-
try:
|
| 174 |
-
response = requests.get(image_url)
|
| 175 |
-
img = Image.open(io.BytesIO(response.content))
|
| 176 |
-
st.image(img, caption="Player Image", width=200)
|
| 177 |
-
except:
|
| 178 |
-
st.warning("Could not load player image")
|
| 179 |
-
|
| 180 |
-
# Initialize session state and load your My_Cricket.csv
|
| 181 |
-
if 'local_db' not in st.session_state:
|
| 182 |
-
CSV_PATH = "My_Cricket.csv" # Your CSV filename
|
| 183 |
-
app = CricketStatsApp()
|
| 184 |
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
# Streamlit UI
|
| 195 |
-
st.title("🏏 Cricket Player Stats Explorer")
|
| 196 |
-
st.markdown(f"""
|
| 197 |
-
Search for any international cricket player to view their statistics.
|
| 198 |
-
The app will first check local database (loaded from `My_Cricket.csv`) before making API calls.
|
| 199 |
-
""")
|
| 200 |
-
|
| 201 |
-
# Search section
|
| 202 |
-
col1, col2 = st.columns([3, 1])
|
| 203 |
-
with col1:
|
| 204 |
-
player_query = st.text_input("Enter player name:", placeholder="e.g. Virat Kohli")
|
| 205 |
-
with col2:
|
| 206 |
-
stat_type = st.selectbox("Stat Type", ["batting", "bowling"], index=0)
|
| 207 |
-
|
| 208 |
-
if player_query:
|
| 209 |
-
with st.spinner("Searching for player..."):
|
| 210 |
-
# First check local database
|
| 211 |
-
local_results = app.search_local_db(player_query)
|
| 212 |
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
|
|
|
|
|
|
| 216 |
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
|
| 228 |
-
|
| 229 |
-
|
|
|
|
|
|
|
|
|
|
| 230 |
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
st.info("Not found locally, checking API...")
|
| 234 |
-
player_info = app.fetch_from_api(player_query)
|
| 235 |
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
# Get stats from API
|
| 240 |
-
with st.spinner(f"Fetching {stat_type} stats..."):
|
| 241 |
-
stats_data = {stat_type: app.get_player_stats(player_info['id'], stat_type)}
|
| 242 |
-
|
| 243 |
-
if stats_data[stat_type]:
|
| 244 |
-
# Update local database
|
| 245 |
-
if app.update_local_db(player_info, stats_data):
|
| 246 |
-
st.success("Added to local database!")
|
| 247 |
-
|
| 248 |
-
# Display results
|
| 249 |
-
st.subheader(f"Player: {player_info['name']}")
|
| 250 |
-
|
| 251 |
-
# Show image if available
|
| 252 |
-
if 'imageUrl' in player_info:
|
| 253 |
-
app.get_player_image(player_info['imageUrl'])
|
| 254 |
-
|
| 255 |
-
# Process and display stats
|
| 256 |
-
processed_stats = app.process_stats(stats_data[stat_type])
|
| 257 |
-
app.display_stats(processed_stats)
|
| 258 |
-
else:
|
| 259 |
-
st.error("Could not fetch player stats")
|
| 260 |
else:
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
#
|
| 264 |
-
|
| 265 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import requests
|
| 2 |
+
import pandas as pd
|
|
|
|
|
|
|
| 3 |
import time
|
| 4 |
+
import random
|
| 5 |
+
from typing import Dict, Optional, List
|
| 6 |
+
from datetime import datetime
|
| 7 |
|
| 8 |
+
class CricketDataFetcher:
|
| 9 |
def __init__(self):
|
| 10 |
+
# Rotating API keys to prevent rate limits
|
| 11 |
+
self.API_KEYS = [
|
| 12 |
+
"YOUR_FIRST_API_KEY",
|
| 13 |
+
"YOUR_SECOND_API_KEY",
|
| 14 |
+
"YOUR_THIRD_API_KEY"
|
| 15 |
+
]
|
| 16 |
+
self.REQUEST_DELAY = 3 # seconds between requests
|
| 17 |
+
self.last_request_time = 0
|
| 18 |
+
|
| 19 |
+
def _make_request(self, url: str, params: Dict = None) -> Optional[Dict]:
|
| 20 |
+
"""Generic API request handler with rate limiting"""
|
| 21 |
+
# Enforce rate limiting
|
| 22 |
+
time_since_last = time.time() - self.last_request_time
|
| 23 |
+
if time_since_last < self.REQUEST_DELAY:
|
| 24 |
+
time.sleep(self.REQUEST_DELAY - time_since_last)
|
| 25 |
+
|
| 26 |
+
headers = {
|
| 27 |
+
"x-rapidapi-key": random.choice(self.API_KEYS),
|
| 28 |
"x-rapidapi-host": "cricbuzz-cricket.p.rapidapi.com"
|
| 29 |
}
|
| 30 |
|
|
|
|
|
|
|
| 31 |
try:
|
| 32 |
+
response = requests.get(url, headers=headers, params=params)
|
| 33 |
+
self.last_request_time = time.time()
|
| 34 |
|
| 35 |
+
if response.status_code == 200:
|
| 36 |
+
return response.json()
|
| 37 |
+
elif response.status_code == 429:
|
| 38 |
+
print("⚠ Rate limit exceeded - waiting before retrying...")
|
| 39 |
+
time.sleep(10)
|
| 40 |
+
return self._make_request(url, params)
|
| 41 |
+
else:
|
| 42 |
+
print(f"⚠ API Error: {response.status_code}")
|
| 43 |
+
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
except Exception as e:
|
| 46 |
+
print(f"⚠ Request failed: {e}")
|
| 47 |
+
return None
|
| 48 |
+
|
| 49 |
+
def search_player_id(self, player_name: str) -> Optional[str]:
|
| 50 |
+
"""Search for player and return their ID"""
|
| 51 |
+
url = "https://cricbuzz-cricket2.p.rapidapi.com/stats/v1/player/search"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
params = {"plrN": player_name}
|
| 53 |
|
| 54 |
+
data = self._make_request(url, params)
|
| 55 |
+
if data and "player" in data and data["player"]:
|
| 56 |
+
return data["player"][0]["id"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
return None
|
| 58 |
+
|
| 59 |
+
def fetch_player_stats(self, player_id: str) -> Dict:
|
| 60 |
+
"""Fetch both batting and bowling stats for a player"""
|
| 61 |
+
stats = {}
|
|
|
|
| 62 |
|
| 63 |
+
# Batting stats
|
| 64 |
+
batting_url = f"https://cricbuzz-cricket.p.rapidapi.com/stats/v1/player/{player_id}/batting"
|
| 65 |
+
batting_data = self._make_request(batting_url)
|
| 66 |
+
if batting_data:
|
| 67 |
+
stats["batting"] = batting_data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
+
# Bowling stats
|
| 70 |
+
bowling_url = f"https://cricbuzz-cricket.p.rapidapi.com/stats/v1/player/{player_id}/bowling"
|
| 71 |
+
bowling_data = self._make_request(bowling_url)
|
| 72 |
+
if bowling_data:
|
| 73 |
+
stats["bowling"] = bowling_data
|
| 74 |
+
|
| 75 |
+
return stats
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
+
def process_player_data(self, player_name: str, existing_data: pd.DataFrame = None) -> Optional[Dict]:
|
| 78 |
+
"""Process player data into wide CSV format"""
|
| 79 |
+
# First check existing data
|
| 80 |
+
if existing_data is not None:
|
| 81 |
+
existing_player = existing_data[existing_data["Player"].str.contains(player_name, case=False)]
|
| 82 |
+
if not existing_player.empty:
|
| 83 |
+
print(f"✅ Found {player_name} in existing data")
|
| 84 |
+
return existing_player.iloc[0].to_dict()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
+
# If not found, fetch from API
|
| 87 |
+
player_id = self.search_player_id(player_name)
|
| 88 |
+
if not player_id:
|
| 89 |
+
print(f"⚠ Player '{player_name}' not found!")
|
| 90 |
+
return None
|
| 91 |
|
| 92 |
+
print(f"✅ Fetching stats for {player_name} (ID: {player_id})")
|
| 93 |
+
stats = self.fetch_player_stats(player_id)
|
| 94 |
+
|
| 95 |
+
# Initialize player data
|
| 96 |
+
player_data = {
|
| 97 |
+
"Player": player_name,
|
| 98 |
+
"Player_ID": player_id,
|
| 99 |
+
"Last_Updated": datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
# Process batting stats
|
| 103 |
+
if "batting" in stats:
|
| 104 |
+
for stat in stats["batting"].get("values", []):
|
| 105 |
+
category = stat["values"][0]
|
| 106 |
+
formats = ["Test", "ODI", "T20", "IPL"]
|
| 107 |
+
for i, fmt in enumerate(formats, start=1):
|
| 108 |
+
if i < len(stat["values"]):
|
| 109 |
+
player_data[f"batting_{category}_{fmt}"] = stat["values"][i]
|
| 110 |
+
|
| 111 |
+
# Process bowling stats
|
| 112 |
+
if "bowling" in stats:
|
| 113 |
+
for stat in stats["bowling"].get("values", []):
|
| 114 |
+
category = stat["values"][0]
|
| 115 |
+
formats = ["Test", "ODI", "T20", "IPL"]
|
| 116 |
+
for i, fmt in enumerate(formats, start=1):
|
| 117 |
+
if i < len(stat["values"]):
|
| 118 |
+
player_data[f"bowling_{category}_{fmt}"] = stat["values"][i]
|
| 119 |
+
|
| 120 |
+
return player_data
|
| 121 |
+
|
| 122 |
+
def update_cricket_data(self, player_names: List[str], input_csv: str = "My_Cricket.csv", output_csv: str = "My_Cricket_Updated.csv"):
|
| 123 |
+
"""Main function to update cricket data"""
|
| 124 |
+
try:
|
| 125 |
+
# Load existing data
|
| 126 |
+
existing_df = pd.read_csv(input_csv) if os.path.exists(input_csv) else pd.DataFrame()
|
| 127 |
+
updated_players = []
|
| 128 |
|
| 129 |
+
for player in player_names:
|
| 130 |
+
player_data = self.process_player_data(player, existing_df)
|
| 131 |
+
if player_data:
|
| 132 |
+
updated_players.append(player_data)
|
| 133 |
+
time.sleep(self.REQUEST_DELAY)
|
| 134 |
|
| 135 |
+
# Create/update DataFrame
|
| 136 |
+
new_df = pd.DataFrame(updated_players)
|
|
|
|
|
|
|
| 137 |
|
| 138 |
+
# Merge with existing data (avoid duplicates)
|
| 139 |
+
if not existing_df.empty:
|
| 140 |
+
combined_df = pd.concat([existing_df, new_df]).drop_duplicates(subset=["Player"], keep="last")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
else:
|
| 142 |
+
combined_df = new_df
|
| 143 |
+
|
| 144 |
+
# Save to CSV
|
| 145 |
+
combined_df.to_csv(output_csv, index=False)
|
| 146 |
+
print(f"✅ Successfully updated {output_csv} with {len(new_df)} players")
|
| 147 |
+
|
| 148 |
+
return combined_df
|
| 149 |
+
|
| 150 |
+
except Exception as e:
|
| 151 |
+
print(f"⚠ Error updating data: {e}")
|
| 152 |
+
return None
|
| 153 |
|
| 154 |
+
if __name__ == "__main__":
|
| 155 |
+
fetcher = CricketDataFetcher()
|
| 156 |
+
|
| 157 |
+
# List of players to fetch/update
|
| 158 |
+
players = [
|
| 159 |
+
"Virat Kohli",
|
| 160 |
+
"MS Dhoni",
|
| 161 |
+
"Rohit Sharma",
|
| 162 |
+
"Jasprit Bumrah"
|
| 163 |
+
]
|
| 164 |
+
|
| 165 |
+
# Run the update
|
| 166 |
+
updated_data = fetcher.update_cricket_data(
|
| 167 |
+
player_names=players,
|
| 168 |
+
input_csv="My_Cricket.csv",
|
| 169 |
+
output_csv="My_Cricket_Updated.csv"
|
| 170 |
+
)
|