shwetashweta05 commited on
Commit
dfb892c
·
verified ·
1 Parent(s): 931791c

Update pages/Automatic_Machine_learning_app.py

Browse files
pages/Automatic_Machine_learning_app.py CHANGED
@@ -1 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import numpy as np
4
+ import plotly.express as px
5
+
6
+ # Set page title
7
+ st.title("Cricket Icons")
8
+
9
+ # Load datasets
10
+ batting_data = pd.read_csv("ireland_batting.csv")
11
+ bowling_data = pd.read_csv("ireland_bowling.csv")
12
+
13
+ # Get unique player names
14
+ players = sorted(set(batting_data["Player"]).intersection(set(bowling_data["Player"])))
15
+
16
+ # Create two columns for Batting and Bowling sections
17
+ col1, col2 = st.columns(2)
18
+
19
+ # ---------------- BATSMAN SECTION ---------------- #
20
+ with col1:
21
+ st.subheader("Batting Statistics")
22
+
23
+ # Select player for batting stats
24
+ batting_player = st.selectbox("Select a Player (Batting):", players, key="batting_player")
25
+
26
+ # Filter the player's batting data
27
+ batting_info = batting_data[batting_data["Player"] == batting_player]
28
+
29
+ # Display batting details
30
+ st.write(f"Batting Information About: {batting_player}")
31
+ st.dataframe(batting_info)
32
+
33
+ # Generate charts
34
+ if not batting_info.empty:
35
+ fig = px.pie(batting_info, names="Cricket Matches", values="Matches", title="Matches Distribution")
36
+ st.plotly_chart(fig)
37
+
38
+ fig = px.bar(batting_info, x="Cricket Matches", y=["Matches", "Innings"], title="Matches vs Innings", barmode="group", text_auto=True)
39
+ st.plotly_chart(fig)
40
+
41
+ fig = px.bar(batting_info, x="Cricket Matches", y=["Matches", "Innings", "Not Out"], title="Matches, Innings & Not Outs", barmode="group", text_auto=True)
42
+ st.plotly_chart(fig)
43
+
44
+ fig = px.bar(batting_info, x="Cricket Matches", y=["Runs", "SR"], title="Runs vs Strike Rate", barmode="group", text_auto=True)
45
+ st.plotly_chart(fig)
46
+
47
+ fig = px.bar(batting_info, x="Cricket Matches", y=["Runs", "Balls"], title="Runs vs Balls", barmode="group", text_auto=True)
48
+ st.plotly_chart(fig)
49
+
50
+ fig = px.bar(batting_info, x="Cricket Matches", y=["Runs", "Fours", "Sixes"], title="Runs vs Fours vs Sixes", barmode="group", text_auto=True)
51
+ st.plotly_chart(fig)
52
+
53
+ fig = px.bar(batting_info, x="Cricket Matches", y=["Fours", "Sixes"], title="Boundary Count (Fours & Sixes)", barmode="group", text_auto=True)
54
+ st.plotly_chart(fig)
55
+
56
+ fig = px.bar(batting_info, x="Cricket Matches", y=["50s", "100s", "200s", "300s", "400s"], title="Player Century Breakdown", barmode="group", text_auto=True)
57
+ st.plotly_chart(fig)
58
+
59
+ fig = px.pie(batting_info, names="Cricket Matches", values="Ducks", title="Players with Ducks")
60
+ st.plotly_chart(fig)
61
+
62
+
63
+ # ---------------- BOWLER SECTION ---------------- #
64
+ with col2:
65
+ st.subheader("Bowling Statistics")
66
+
67
+ # Select player for bowling stats
68
+ bowling_player = st.selectbox("Select a Player (Bowling):", players, key="bowling_player")
69
+
70
+ # Filter the player's bowling data
71
+ bowling_info = bowling_data[bowling_data["Player"] == bowling_player]
72
+
73
+ # Display bowling details
74
+ st.write(f"Bowling Information About: {bowling_player}")
75
+ st.dataframe(bowling_info)
76