Skip to main content

Python

  • Chapter
  • First Online:
Computer Science in Sport
  • 212 Accesses

Abstract

This chapter introduces the programming language Python and its relevance for computer science in sport. The need for programming languages in sports analytics is based on the variety of tasks from data import, pre-processing and visualization, to statistical modelling. Python is a dynamic, object-oriented, high-level programming language and especially popular among Data Scientists. Consequently, it also has made an impact in sports analytics. The variety of functionalities provided by Python’s libraries enables implementing the analysis process completely in Python. This process contains data import, pre-processing by means of filtering, grouping and aggregation, visualization as well as modelling by either “traditional” inferential statistics of Machine Learning and it is illustrated alongside the required libraries in this chapter.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 89.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  • Anzer, G., & Bauer, P. (2021). A goal scoring probability model for shots based on synchronized positional and event data in football (soccer). Frontiers in Sports and Active Living, 3, 624475.

    Article  Google Scholar 

  • Barrett, P., Hunter, J., Miller, J. T., Hsu, J.-C., & Greenfield, P. (2005). matplotlib—A portable python plotting package. In Astronomical data analysis software and systems XIV.

    Google Scholar 

  • Bassek, M., Raabe, D., Memmert, D., & Rein, R. (2022). Analysing motion characteristics and metabolic power in elite male handball players. Journal of Sports Science and Medicine, 22(2), 310–316.

    Google Scholar 

  • Bourbousson, J., Sève, C., & McGarry, T. (2010). Space–time coordination dynamics in basketball: Part 2. The interaction between the two teams. Journal of Sports Sciences, 28(3), 349–358.

    Article  Google Scholar 

  • Decroos, T., Bransen, L., Van Haaren, J., & Davis, J. (2019). Actions speak louder than goals: Valuing player actions in soccer. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining.

    Google Scholar 

  • Di Prampero, P. E., & Osgnach, C. (2018). Metabolic power in team sports—Part 1: An update. International Journal of Sports Medicine, 39(08), 581–587.

    Article  Google Scholar 

  • Klemp, M., Wunderlich, F., & Memmert, D. (2021). In-play forecasting in football using event and positional data. Scientific Reports, 11(1), 1–10.

    Article  Google Scholar 

  • Lorenzo-Martínez, M., Rein, R., Garnica-Caparrós, M., Memmert, D., & Rey, E. (2022). The effect of substitutions on team tactical behavior in professional soccer. Research Quarterly for Exercise and Sport, 93(2), 301–309.

    Article  Google Scholar 

  • McKinney, W. (2010). Data structures for statistical computing in python. In Proceedings of the 9th python in science conference.

    Google Scholar 

  • McKinney, W. (2011). pandas: A foundational python library for data analysis and statistics. Python for High Performance and Scientific Computing, 14(9), 1–9.

    Google Scholar 

  • Memmert, D., & Raabe, D. (2018). Data analytics in football: Positional data collection, modelling and analysis. Routledge.

    Book  Google Scholar 

  • Memmert, D., Raabe, D., Schwab, S., & Rein, R. (2019). A tactical comparison of the 4-2-3-1 and 3-5-2 formation in soccer: A theory-oriented, experimental approach based on positional data in an 11 vs. 11 game set-up. PLoS One, 14(1), e0210191.

    Article  CAS  Google Scholar 

  • Oliphant, T. E. (2006). A guide to NumPy (Vol. Vol. 1). Trelgol Publishing USA.

    Google Scholar 

  • Pappalardo, L., Cintia, P., Rossi, A., Massucco, E., Ferragina, P., Pedreschi, D., & Giannotti, F. (2019). A public data set of spatio-temporal match events in soccer competitions. Scientific Data, 6(1), 1–15.

    Article  Google Scholar 

  • Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, É. (2011). Scikit-learn: Machine learning in python. The Journal of Machine Learning Research, 12, 2825–2830.

    Google Scholar 

  • Pincus, S. M. (1991). Approximate entropy as a measure of system complexity. Proceedings of the National Academy of Sciences, 88(6), 2297–2301.

    Article  CAS  Google Scholar 

  • Raabe, D., Biermann, H., Bassek, M., Wohlan, M., Komitova, R., Rein, R., Groot, T. K., & Memmert, D. (2022). floodlight—A high-level, data-driven sports analytics framework. Journal of Open Source Software, 7(76), 4588.

    Article  Google Scholar 

  • Seabold, S., & Perktold, J. (2010). Statsmodels: Econometric and statistical modeling with python. In Proceedings of the 9th python in science conference.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer-Verlag GmbH, DE, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Klemp, M. (2024). Python. In: Memmert, D. (eds) Computer Science in Sport. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-68313-2_15

Download citation

Publish with us

Policies and ethics