|
runs_t = numpy.transpose(runs) |
In the code:
runs = numpy.column_stack((nr, val)) runs_t = numpy.transpose(runs)
it's recommended to replace numpy.transpose() with .T:
runs_t = runs.T
Both approaches are equivalent for 2D arrays, but .T is more concise and performs slightly better since it directly accesses the array’s transpose attribute, avoiding unnecessary function call overhead. This small change improves both code clarity and efficiency.
PhotonFileEditor/PhotonFile.py
Line 521 in 3417fff
In the code:
runs = numpy.column_stack((nr, val)) runs_t = numpy.transpose(runs)it's recommended to replace numpy.transpose() with .T:
runs_t = runs.TBoth approaches are equivalent for 2D arrays, but .T is more concise and performs slightly better since it directly accesses the array’s transpose attribute, avoiding unnecessary function call overhead. This small change improves both code clarity and efficiency.