import streamlit as st st.markdown( """ # Traffic Analysis Application Documentation ## Overview The Traffic Analysis application is a Streamlit-based tool designed to analyze and visualize 2G, 3G, and LTE network traffic data. It provides insights into voice and data traffic patterns, performs comparative analysis between different time periods, and generates visual reports. ## Features ### 1. Multi-Technology Support - **2G Traffic Analysis** - Voice traffic analysis - Data traffic analysis - PS (Packet Switched) traffic metrics - **3G Traffic Analysis** - CS (Circuit Switched) voice traffic - PS data traffic - Combined traffic metrics - **LTE Traffic Analysis** - UL/DL data traffic - Combined traffic volume ### 2. Comparative Analysis - Pre/Post period comparison - Traffic trend analysis - Monthly traffic aggregation - Traffic growth/decline metrics ### 3. Visualization - Interactive maps showing traffic distribution - Top N sites analysis - Traffic trend charts - Comparative bar charts ## Input Requirements ### Required Files 1. **2G Traffic Report** - Required columns: `BCF name`, `PERIOD_START_TIME`, `TRAFFIC_PS DL`, `PS_UL_Load` - Format: CSV or ZIP containing CSV 2. **3G Traffic Report** - Required columns: `WBTS name`, `PERIOD_START_TIME`, `Total CS traffic - Erl`, `Total_Data_Traffic` - Format: CSV or ZIP containing CSV 3. **LTE Traffic Report** - Required columns: `LNBTS name`, `PERIOD_START_TIME`, `4G/LTE DL Traffic Volume (GBytes)`, `4G/LTE UL Traffic Volume (GBytes)` - Format: CSV or ZIP containing CSV ## Usage ### 1. Data Upload - Upload the three required reports using the file uploaders - Supported formats: CSV or ZIP (containing CSV) ### 2. Date Range Selection - **Pre-period**: Select the baseline period for comparison - **Post-period**: Select the period to compare against the baseline - **Last period**: Select the most recent period for current analysis ### 3. Analysis Configuration - Set the number of top traffic sites to display - The application will automatically process and analyze the data ### 4. Results - **Summary Analysis**: Overview of traffic metrics - **Top Sites**: Lists and charts of highest traffic sites - **Maps**: Geographical visualization of traffic distribution - **Monthly Trends**: Traffic patterns over time ## Technical Implementation ### Key Functions 1. **Data Processing** - preprocess_2g(): Processes 2G traffic data - preprocess_3g(): Processes 3G traffic data - preprocess_lte(): Processes LTE traffic data 2. **Analysis Functions** - merge_and_compare(): Combines and compares traffic data across technologies - monthly_data_analysis(): Aggregates data by month for trend analysis 3. **Visualization** - Interactive maps using Plotly - Bar charts for top sites - Data tables with sortable columns ## Dependencies - Python 3.7+ - pandas - plotly - streamlit - numpy ## Output The application generates: 1. Summary tables of traffic metrics 2. Interactive visualizations 3. Exportable reports in Excel format ## Best Practices 1. Ensure input files follow the required format 2. Select appropriate date ranges for meaningful comparison 3. Review top traffic sites for network optimization opportunities 4. Use the monthly analysis to identify long-term trends ## Troubleshooting - If data doesn't load, check file formats and required columns - Ensure date ranges are properly selected - Verify that uploaded files contain valid data """ )