Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import pandas as pd | |
| import plotly.express as px | |
| # Load the Excel file from a URL | |
| def load_data(url): | |
| return pd.read_excel(url) | |
| # Function to filter data | |
| def filter_data(df, location_region, priority, month): | |
| filtered_df = df[(df['Location Region'] == location_region) & | |
| (df['Priority'] == priority) & | |
| (df['Month'] == month)] | |
| return filtered_df | |
| # Function to create timeline | |
| def create_timeline(df): | |
| fig = px.timeline(df, x_start="Actual Date", x_end="Actual Date", y="Name", color="Location Region", title="Conference Timeline") | |
| fig.update_yaxes(categoryorder="total ascending") | |
| return fig | |
| # Streamlit app | |
| def main(): | |
| st.title("AI Conferences Timeline") | |
| # Load data from URL | |
| url = "https://huggingface.co/datasets/Bexaga/AI-Conference/resolve/main/AI%20conferences%202025.xlsx" | |
| data = load_data(url) | |
| # Sidebar for filters | |
| st.sidebar.header("Filter Options") | |
| location_regions = data['Location Region'].unique() | |
| selected_location_region = st.sidebar.selectbox("Select Location Region", location_regions) | |
| priorities = data['Priority'].unique() | |
| selected_priority = st.sidebar.selectbox("Select Priority", priorities) | |
| months = data['Month'].unique() | |
| selected_month = st.sidebar.selectbox("Select Month", months) | |
| # Filter data based on user input | |
| filtered_data = filter_data(data, selected_location_region, selected_priority, selected_month) | |
| # Display filtered data | |
| st.subheader("Filtered Conferences") | |
| st.dataframe(filtered_data[['Category', 'Name', 'Priority', 'Coverage', 'Month', 'Actual Date', 'Date status', 'URL', 'Location Region', 'Location']]) | |
| # Create and display timeline | |
| st.subheader("Conference Timeline") | |
| timeline_fig = create_timeline(filtered_data) | |
| st.plotly_chart(timeline_fig) | |
| if __name__ == "__main__": | |
| main() | |