create a streamlit app which scratches all MMA fighters' data on the internet and show some cool stats about them
Drop files here
or click to upload
import streamlit as st
import pandas as pd
from scrape import scrape_mma_fighters
st.title("MMA Fighters Stats")
# Get fighter data
fighter_data = scrape_mma_fighters()
# Create DataFrame
df = pd.DataFrame(fighter_data)
# Display DataFrame
st.write(df)
# Show some stats
st.write("### Stats")
st.write(f"Total Fighters: {len(df)}")
st.write(f"Total Wins: {df['Wins'].sum()}")
st.write(f"Total Losses: {df['Losses'].sum()}")
if st.button("Show Fighters with Most Wins"):
top_winners = df.nlargest(10, 'Wins')
st.write(top_winners)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?