# Resilience Analysis of Traffic Network under Emergencies: A Case Study of Bus Transit Network
## 4 Case Analysis
### Description of Usage Data
The data used for the analysis of network resilience includes three datasets: \"Bus Route Data,\" \"Bus Stop Data,\" and \"Bus Card Swiping Data.\" In the context of studying unexpected events, the data covers a time range from 10 to 16 August 2020, spanning one week, with data collected at an hourly granularity. The unexpected event in this case is heavy rainfall on August 12. Based on the available data, this analysis selected 152 bus routes and 1547 bus stops. Prior to using the data, it is necessary to check and process redundant data, missing values, outliers, and other data issues. The necessary data filtering conditions are outlined in Table 6.  
The handling of redundant, abnormal, and missing data. As the basic data of bus routes and bus stops can be regarded as ordinary descriptive files, there are no significant data quality issues such as redundant data, missing values, and anomalies, making them directly usable. Therefore, the only task in the bus route data and bus stop data is to delete data fields that are irrelevant to passenger flow. By linking them through the \"line code\" field, they are combined into a dataset for bus routes and stops to match the IC card swipe data. The daily IC card swipe dataset contains millions of swipe records, some of which may contain abnormal data, requiring data cleaning. The data cleaning process for the IC card swipe data in this instance mainly includes the following steps:  
1. Remove duplicate records: The IC card swipe dataset may have redundant and duplicate data, which needs to be removed first. 2. Remove irrelevant data: Irrelevant data refers to data that does not affect the analysis of bus passenger flow, such as the creation time of a record, which can be directly deleted. 3. Remove records without corresponding line codes: In the IC card swipe dataset, there are a small number of swipe records with large station indices that are not within the specified station range and must be removed. 4. Remove records in \"MARKSTATION\" and \"TRADESTATION\" that do not belong to line station indices (different directions have different station indices): \"MARKSTATION\" and \"TRADESTATION\" represent boarding and alighting stations, respectively. \begin{table}
\begin{tabular}{c c} \hline \hline
**Condition** & **Value** \\ \hline date & 10–16 August 2020 \\ Bus line & 152 bus routes \\ Bus stop & 1547 bus stops \\ Bus type & Regular \\ Operation time & 00:00–23:00 \\ Time granularity & 1 h \\ Running direction & Ascending, descending and descending \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Data filtering condition. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Site Serial Number** & **Stop Name** & **Site Serial Number** & **Stop Name** \\ \hline
1 & Sihui Hub Station & 8 & Chaoyangmennei Station \\
2 & Bawangfen West Station & 9 & Chaonei Xiaojie Station \\
3 & Langjiayuan Station & 10 & Dongsikou East Station \\
4 & Dabeiyao West Station & 11 & Art Museum East Station \\
5 & Yong’anli Intersection West Station & 12 & Beach Crossing West Station \\
6 & Ritan Road Station & 13 & Palace Museum Station \\
7 & Yabao Road Station & \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Beijing bus No.58’stops. Remove data where \"TRADESTATION\" is less than or equal to \"MARKSTATION\": If the card swiping is not performed correctly, the starting and ending stations may record the same information. In such cases, abnormal data must be removed. 6. Remove data in \"MARKSTATION\" and \"TRADESTATION\" that are not within the day (00:00-24:00): For IC card swipe data, two situations can lead to data quality issues. One is when passengers make card swipes incorrectly. Some passengers may forget to swipe or swipe again when getting off, so complete data will only be recorded when they swipe the card on their next trip. Therefore, the swipe records may contain boarding and alighting data that do not belong to the current day. The other situation is incomplete records during data transmission.