reformated network python graph