-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Description
Line 35 in bcdb677
| input_direction_max[count, :] = numpy.transpose(V[:, 0]) |
In the code:
output_direction_max[count, :] = numpy.transpose(U[:, 0]) input_direction_max[count, :] = numpy.transpose(V[:, 0]) output_direction_min[count, :] = numpy.transpose(U[:, -1]) input_direction_min[count, :] = numpy.transpose(V[:, -1]) it is recommended to use .T instead of numpy.transpose().
Both are functionally equivalent, but .T is more concise and performs slightly better because it directly accesses the array's transpose attribute without going through an extra function call stack. This becomes especially beneficial in performance-critical code or high-frequency operations.
Suggested improvement:
output_direction_max[count, :] = U[:, 0].T input_direction_max[count, :] = V[:, 0].T output_direction_min[count, :] = U[:, -1].T input_direction_min[count, :] = V[:, -1].T
Metadata
Metadata
Assignees
Labels
No labels