Closed OrtnerMichael closed 2 days ago
Hi @OrtnerMichael,
I don't see much benefit in terms of memory here, especially with the B-field computation coming afterwards.
BTW I fixed the code in your comment above to make it work (you had 101 instead of 100 in np.zeros(...
You can also make it a one-liner:
grid = np.mgrid[-1:1:100j, 0:0:1j, -1:1:100j].T[:,0]
this is very nice !
A memory efficient way to create a grid with numpy by broadcasting into an allocated array - no respective creation of
X
andY
grids as in the docs example here