I went from being an anthropologist (post doc) to being a programmer. I'd done a lot of Monte Carlo simulation as part of my thesis, and new programming was a possibility. In my case, we were wandering through a University library for old-times sake when my then wife and I noticed an ad for programmer trainees on a computer screen...
So, I'm not sure how replicable that was, other than keep your eyes out and be willing to take a chance.
I think the first thing is to imagine, broadly, what it is you want to do, and then look at the entry paths for that.