Upload 3 files
Browse files- .gitattributes +1 -0
- app.py +55 -0
- bfro_reports_fall2022.csv +3 -0
- requirements.txt +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
bfro_reports_fall2022.csv filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import altair as alt
|
| 4 |
+
|
| 5 |
+
# Load dataset
|
| 6 |
+
df = pd.read_csv('bfro_reports_fall2022.csv')
|
| 7 |
+
|
| 8 |
+
# Preprocess for first chart
|
| 9 |
+
df['year'] = pd.to_datetime(df['date'], errors='coerce').dt.year
|
| 10 |
+
df_year = df.groupby('year').size().reset_index(name='count').dropna()
|
| 11 |
+
|
| 12 |
+
# Preprocess for second chart
|
| 13 |
+
df_state = df['state'].value_counts().reset_index()
|
| 14 |
+
df_state.columns = ['state', 'count']
|
| 15 |
+
|
| 16 |
+
# Title and Introduction
|
| 17 |
+
st.title('Bigfoot Sightings Analysis')
|
| 18 |
+
st.markdown("""
|
| 19 |
+
This dataset from the BFRO contains reported Bigfoot sightings across the US.
|
| 20 |
+
Below are two visualizations to explore patterns in the data.
|
| 21 |
+
""")
|
| 22 |
+
|
| 23 |
+
# Chart 1
|
| 24 |
+
st.subheader('Sightings Per Year')
|
| 25 |
+
chart1 = alt.Chart(df_year).mark_line(point=True).encode(
|
| 26 |
+
x=alt.X('year:O', title='Year'),
|
| 27 |
+
y=alt.Y('count:Q', title='Number of Sightings'),
|
| 28 |
+
tooltip=['year', 'count']
|
| 29 |
+
).properties(
|
| 30 |
+
width=600,
|
| 31 |
+
height=400
|
| 32 |
+
)
|
| 33 |
+
st.altair_chart(chart1, use_container_width=True)
|
| 34 |
+
|
| 35 |
+
st.text("""
|
| 36 |
+
This line chart shows the number of sightings reported each year.
|
| 37 |
+
The point markers emphasize yearly changes. The trend could be smoothed with more time.
|
| 38 |
+
""")
|
| 39 |
+
|
| 40 |
+
# Chart 2
|
| 41 |
+
st.subheader('Top 15 States by Sightings')
|
| 42 |
+
chart2 = alt.Chart(df_state.head(15)).mark_bar().encode(
|
| 43 |
+
x=alt.X('count:Q', title='Number of Sightings'),
|
| 44 |
+
y=alt.Y('state:N', sort='-x', title='State'),
|
| 45 |
+
tooltip=['state', 'count']
|
| 46 |
+
).properties(
|
| 47 |
+
width=600,
|
| 48 |
+
height=400
|
| 49 |
+
)
|
| 50 |
+
st.altair_chart(chart2, use_container_width=True)
|
| 51 |
+
|
| 52 |
+
st.text("""
|
| 53 |
+
This bar chart highlights the top states with the most Bigfoot sightings.
|
| 54 |
+
A geographic map could provide more visual insight if time permits.
|
| 55 |
+
""")
|
bfro_reports_fall2022.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:302c6b7cc392dfe52c9c4890bf96f2b3ccdf1911fef803a3e86d1a3540071c88
|
| 3 |
+
size 10716765
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
pandas
|
| 3 |
+
altair
|