Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,20 +2,20 @@ import streamlit as st
|
|
| 2 |
import pandas as pd
|
| 3 |
import plotly.express as px
|
| 4 |
|
| 5 |
-
# Load the Excel file
|
| 6 |
-
def load_data(
|
| 7 |
-
return pd.read_excel(
|
| 8 |
|
| 9 |
# Function to filter data
|
| 10 |
-
def filter_data(df,
|
| 11 |
-
filtered_df = df[(df['Region'] ==
|
| 12 |
-
(df['
|
| 13 |
-
(df['
|
| 14 |
return filtered_df
|
| 15 |
|
| 16 |
# Function to create timeline
|
| 17 |
def create_timeline(df):
|
| 18 |
-
fig = px.timeline(df, x_start="
|
| 19 |
fig.update_yaxes(categoryorder="total ascending")
|
| 20 |
return fig
|
| 21 |
|
|
@@ -23,23 +23,25 @@ def create_timeline(df):
|
|
| 23 |
def main():
|
| 24 |
st.title("AI Conferences Timeline")
|
| 25 |
|
| 26 |
-
# Load data
|
| 27 |
-
|
| 28 |
-
data = load_data(
|
| 29 |
|
| 30 |
# Sidebar for filters
|
| 31 |
st.sidebar.header("Filter Options")
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
|
| 37 |
# Filter data based on user input
|
| 38 |
-
filtered_data = filter_data(data,
|
| 39 |
|
| 40 |
# Display filtered data
|
| 41 |
st.subheader("Filtered Conferences")
|
| 42 |
-
st.dataframe(filtered_data)
|
| 43 |
|
| 44 |
# Create and display timeline
|
| 45 |
st.subheader("Conference Timeline")
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import plotly.express as px
|
| 4 |
|
| 5 |
+
# Load the Excel file from a URL
|
| 6 |
+
def load_data(url):
|
| 7 |
+
return pd.read_excel(url)
|
| 8 |
|
| 9 |
# Function to filter data
|
| 10 |
+
def filter_data(df, location_region, priority, month):
|
| 11 |
+
filtered_df = df[(df['Location Region'] == location_region) &
|
| 12 |
+
(df['Priority'] == priority) &
|
| 13 |
+
(df['Month'] == month)]
|
| 14 |
return filtered_df
|
| 15 |
|
| 16 |
# Function to create timeline
|
| 17 |
def create_timeline(df):
|
| 18 |
+
fig = px.timeline(df, x_start="Actual Date", x_end="Actual Date", y="Name", color="Location Region", title="Conference Timeline")
|
| 19 |
fig.update_yaxes(categoryorder="total ascending")
|
| 20 |
return fig
|
| 21 |
|
|
|
|
| 23 |
def main():
|
| 24 |
st.title("AI Conferences Timeline")
|
| 25 |
|
| 26 |
+
# Load data from URL
|
| 27 |
+
url = "https://huggingface.co/datasets/Bexaga/AI-Conference/resolve/main/AI%20conferences%202025.xlsx"
|
| 28 |
+
data = load_data(url)
|
| 29 |
|
| 30 |
# Sidebar for filters
|
| 31 |
st.sidebar.header("Filter Options")
|
| 32 |
+
location_regions = data['Location Region'].unique()
|
| 33 |
+
selected_location_region = st.sidebar.selectbox("Select Location Region", location_regions)
|
| 34 |
+
priorities = data['Priority'].unique()
|
| 35 |
+
selected_priority = st.sidebar.selectbox("Select Priority", priorities)
|
| 36 |
+
months = data['Month'].unique()
|
| 37 |
+
selected_month = st.sidebar.selectbox("Select Month", months)
|
| 38 |
|
| 39 |
# Filter data based on user input
|
| 40 |
+
filtered_data = filter_data(data, selected_location_region, selected_priority, selected_month)
|
| 41 |
|
| 42 |
# Display filtered data
|
| 43 |
st.subheader("Filtered Conferences")
|
| 44 |
+
st.dataframe(filtered_data[['Category', 'Name', 'Priority', 'Coverage', 'Month', 'Actual Date', 'Date status', 'URL', 'Location Region', 'Location']])
|
| 45 |
|
| 46 |
# Create and display timeline
|
| 47 |
st.subheader("Conference Timeline")
|