What is Nostr?
Alexandre B A Villares 🐍 /
npub13qa…alcv
2023-11-20 15:32:43

Alexandre B A Villares 🐍 on Nostr: Hey #Python #numpy friends, which is better/faster? Are they the same? triangles_conc ...

Hey #Python #numpy friends, which is better/faster? Are they the same?

triangles_conc = np.concatenate((a, b, c), axis=1).reshape(-1, 2)

triangles_stack = np.hstack((a, b, c)).reshape(-1, 2)


Context: Drawing "boids" as triangles.

triangles = np.hstack(
(left_points, right_points, head_points)).reshape(-1, 2)
with py5.begin_shape(py5.TRIANGLES):
py5.vertices(triangles)


#py5 #boids

Author Public Key
npub13qa4ushxn7jwk2lwwmj4tsshq2953hrkwmmpg57875r06x3n4d3qenalcv