The problem is the line above, u_e is a numpy array after assignment, and Therefore does not have the attribute sub.
For any further questions, please make a minimal example of what you want to do, and what goes wrong, as your current example is not following any of the guidelines in Read before posting: How do I get my question answered?