Absolutely. Python is great for SEO, especially when combined with machine learning. You can use it for keyword clustering, competitor analysis, search intent classification and identifying content gaps.
With today's AI coding tools, you don't even need advanced programming skills to start building your own SEO tools.
What exactly are you trying to achieve with machine learning in SEO?