MCPcopy
hub / github.com/pydata/xarray / easy_array

Function easy_array

xarray/tests/test_plot.py:131–138  ·  view source on GitHub ↗

Make an array with desired shape using np.linspace shape is a tuple like (2, 3)

(shape: tuple[int, ...], start: float = 0, stop: float = 1)

Source from the content-addressed store, hash-verified

129
130
131def easy_array(shape: tuple[int, ...], start: float = 0, stop: float = 1) -> np.ndarray:
132 """
133 Make an array with desired shape using np.linspace
134
135 shape is a tuple like (2, 3)
136 """
137 a = np.linspace(start, stop, num=math.prod(shape))
138 return a.reshape(shape)
139
140
141def get_colorbar_label(colorbar) -> str:

Calls 2

linspaceMethod · 0.80
prodMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…