Spaces:
Build error
Build error
Ayush commited on
Commit ·
cde55c2
1
Parent(s): 547bd9f
uploaded
Browse files- app.py +23 -0
- match_up_impact.csv +0 -0
app.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
df = pd.read_csv('./match_up_impact.csv')
|
| 5 |
+
|
| 6 |
+
def filter_dataframe(batter, bowler):
|
| 7 |
+
filtered_df = df[(df['Batter'] == batter) & (df['Bowler'] == bowler)]
|
| 8 |
+
return filtered_df
|
| 9 |
+
|
| 10 |
+
iface = gr.Interface(
|
| 11 |
+
fn=filter_dataframe,
|
| 12 |
+
inputs=[
|
| 13 |
+
gr.Textbox(label="Enter Batter Name", type="text"),
|
| 14 |
+
gr.Textbox(label="Enter Bowler Name", type="text")
|
| 15 |
+
],
|
| 16 |
+
outputs=gr.Dataframe(type='pandas'),
|
| 17 |
+
live=True,
|
| 18 |
+
capture_session=True,
|
| 19 |
+
title="Cricket Stats",
|
| 20 |
+
description="Enter Batter and Bowler names to filter the DataFrame."
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
iface.launch()
|
match_up_impact.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|