How to launch a EC2 instance and run a task on-demand
I would go with the most simple solution as this is not that complicated task (from the architectural perspective).
Configure S3 event for a bucket, the one where you are storing the new big 3D array, to trigger lambda function once the object has been put into the bucket (you can be more granular and trigger it based on prefix if you are storing all/different data in the same bucket).
Inside of that lambda function, you simply launch new EC2 instance and pass user data script to it that will download necessary files and run the task (this can be done using boto3 for Python).
Using CloudFormation in this case would be overkill (my opinion).
We are developing an deep learning application on AWS. The automation of model training is quite challenging. The first step is to prepare the data for training which involves generating a huge 3D  numpy array (> 100GB) from hundreds of thousands of small 2D numpy arrays. The small numpy arrays are saved in S3 bucket as small files. After the conversion, the big numpy array will saved to another S3 bucket. The training script will pick up the big 3D numpy array before the training. Since lambda function has a memory limit so we will have to launch an EC2 instance manually. 
I wonder what is the best practice to launch a EC2 instance from external and run the python script on the instance to do the data loading and transformation? 
The whole workflow will probably be automated using AWS step function.