@ -2163,15 +2163,15 @@ drawer = cg.output.GraphvizOutput(output_file=filename)
< pre > < code class = "python language-python hljs" > < array> = np.array(< list/list_of_lists> ) < span class = "hljs-comment" > # Returns a 1d/2d NumPy array.< / span >
< array> = np.zeros/ones(< shape> ) < span class = "hljs-comment" > # Also np.full(< shape> , < el> ).< / span >
< array> = np.arange(from_inc, to_exc, ±step) < span class = "hljs-comment" > # Also np.linspace(start, stop, num ).< / span >
< array> = np.arange(from_inc, to_exc, ±step) < span class = "hljs-comment" > # Also np.linspace(start, stop, le n).< / span >
< array> = np.random.randint(from_inc, to_exc, < shape> ) < span class = "hljs-comment" > # Also np.random.random(< shape> ).< / span >
< / code > < / pre >
< pre > < code class = "python language-python hljs" > < view> = < array> .reshape(< shape> ) < span class = "hljs-comment" > # Also `< array> .shape = < shape> `.< / span >
< array> = < array> .flatten() < span class = "hljs-comment" > # Collapses array into one dimension .< / span >
< view> = < array> .squeeze() < span class = "hljs-comment" > # Removes dimensions of length one .< / span >
< array> = < array> .flatten() < span class = "hljs-comment" > # Also `< view> = < array> .ravel()` .< / span >
< view> = < array> .transpose() < span class = "hljs-comment" > # Also `< view> = < array> .T` .< / span >
< / code > < / pre >
< pre > < code class = "python language-python hljs" > < array> = < array> .sum/min/mean/var/std([axis] ) < span class = "hljs-comment" > # Passed dimension gets aggregated .< / span >
< array> = < array> .argmin([axis]) < span class = "hljs-comment" > # Returns indexes of smallest elements .< / span >
< pre > < code class = "python language-python hljs" > < array> = np.copy/int64/float64( < array> ) < span class = "hljs-comment" > # Returns new array of the same shape .< / span >
< array> = < array> .sum/max/mean/argmax/all([axis]) < span class = "hljs-comment" > # Passed dimension gets aggregated .< / span >
< array> = np.apply_along_axis(< func> , axis, < array> ) < span class = "hljs-comment" > # Func can return a scalar or array.< / span >
< / code > < / pre >
< ul >