Update app.py
Browse files
app.py
CHANGED
|
@@ -27,6 +27,29 @@ st.markdown(
|
|
| 27 |
# Wrap the main content in a container with the specified width
|
| 28 |
st.markdown('<div class="main-container">', unsafe_allow_html=True)
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
# Load the data
|
| 31 |
df = pd.read_csv("2024_regular_data.csv", index_col=[0])
|
| 32 |
df['batter_name_team'] = df['batter_name'] + ' - ' + df['batter_team']
|
|
|
|
| 27 |
# Wrap the main content in a container with the specified width
|
| 28 |
st.markdown('<div class="main-container">', unsafe_allow_html=True)
|
| 29 |
|
| 30 |
+
# Example text with links and bullet points
|
| 31 |
+
markdown_text = """
|
| 32 |
+
## Catch Probability Lookup Tool
|
| 33 |
+
|
| 34 |
+
This Streamlit app retrieves catch probability data for a selected fielder from Baseball Savant.
|
| 35 |
+
The app displays the fielder's data in a table and allows the user to select a
|
| 36 |
+
row to view the corresponding catch video.
|
| 37 |
+
|
| 38 |
+
Catch probability data is only available for outfielders.
|
| 39 |
+
|
| 40 |
+
#### What is Catch Probability?
|
| 41 |
+
*From MLB:*
|
| 42 |
+
**Catch Probability** expresses the likelihood for a ball to be caught by an outfielder based on opportunity time,
|
| 43 |
+
distance needed, and direction. “Opportunity time” starts when the ball is released by the pitcher,
|
| 44 |
+
and “distance needed” is the shortest distance needed to make the catch.
|
| 45 |
+
Learn more about how direction is accounted for here. [Read more about the details of how Catch Probability works here](https://www.mlb.com/news/statcast-introduces-catch-probability-for-2017-c217802340).
|
| 46 |
+
|
| 47 |
+
"""
|
| 48 |
+
|
| 49 |
+
# Display the markdown text in Streamlit
|
| 50 |
+
st.markdown(markdown_text)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
# Load the data
|
| 54 |
df = pd.read_csv("2024_regular_data.csv", index_col=[0])
|
| 55 |
df['batter_name_team'] = df['batter_name'] + ' - ' + df['batter_team']
|