I have an np.array
of objects and I want to apply the same method to each object in this array. For example:
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 2,)
now I want gridlines in every axes object. I know I can do this by iterating over the ax
array with an for-loop.
for i in ax:
i.grid()
Is there a more elegant method? Like np.somefunction(array, method)
.