In this paper, through the introduction of case-based teaching method in Python public elective course, combined with data analysis problems in mathematical modeling competition, we carry out a series of explorationsand reforms, aiming to cultivate the application ability of students, and achieve the purpose of learning to apply, in data analysis and mathematical modeling.