> is the Python code running inside the PostgreSQL instance?
Yes, it is using the PL Python language so it runs in the PostgreSQL instance. With some help from Tom, I've been able to make the change needed to allow this transform.
I need to do some more testing, but my preliminary results for the arrays I'm interested in show transforming Postgres to Numpy is about 5x faster and transforming Numpy back to Postgres about 2x faster.