Python Write Numpy Array To Binary Tree