In terms of code, code is a tool so if it gets you where you want, then you can ignore the following thoughts:
Its possible to initiate the entire 500k random samples at once with an extension to the numpy code. Following this i think you could do vector/matrix multiplication to get where you...