The folder contains Python codes from the article "Connecting mass-action models and network models for infectious diseases" by Thien-Minh Le and Jukka-Pekka Onnela. In real data analysis section, the code use the empirical data which is publicly available from Sapiezynski, P ., et.al., “Interaction data from the Copenhagen networks study”, Scientific Data 6, 315 (2019). For further queries regarding the codes, please contact [email protected] or [email protected]. Thank you.