Restructuring Array In Python Problem