update python style

Use numpy instead of global scipy namespace.