Python was popular as a teaching language, how it gained a foothold in academia.
I remember 20 years ago when I was starting out it was popular for game scripting (Lua was more embeddable but python was also used). plenty of first class interfacing methods to native code (still remember c++ boost shipping python binding generator).
Many tools shipped python as an embedded scripting language.
Python was used for creating build systems.
Not to mention any distro out there ships python, it replaced perl in that regard. Batteries included and being available helped it become the norm for random scripting.
Python was big before numpy/ML.