what if you like both? Asking for myself since I'm transitioning to a product ownership role. To be fair, i've only been coding professionally for 3 years (nonprofessionally for ~20), but in my current role I rescued two products, have done technical demos and customer engagement.
If you like both then find a technical product management role. Products with heavy ML or data science components can benefit greatly from PMs that can code, mock, and do ad hoc analysis.
That's kind of what I'll be doing! Making mock demos for customers, owning a cloud -> on prem product vertical, organizing qa/qc, and there is a data science component!!
Thanks that gives me a bit more confidence, since I don't have as much experience with personnel management outside of a few interns (who have been all wildly successful in their internships).
Then a PM role might be right for you.
If you love coding/technology or don't have good presenting/selling skills then stick to engineering... my $0.2.