@ -1017,7 +1017,7 @@ Z = dataclasses.make_dataclass(<span class="hljs-string">'Z'</span>, [<span clas
(< span class = "hljs-number" > 1< / span > , < span class = "hljs-number" > 2< / span > , < span class = "hljs-number" > 3< / span > )
< / code > < / pre >
< div > < h3 id = "contextmanager" > Context Manager< / h3 > < ul >
< li > < strong > With statements only work with objects that have enter() and exit() special methods.< / strong > < / li >
< li > < strong > With statements only work on objects that have enter() and exit() special methods.< / strong > < / li >
< li > < strong > Enter() should lock the resources and optionally return an object.< / strong > < / li >
< li > < strong > Exit() should release the resources.< / strong > < / li >
< li > < strong > Any exception that happens inside the with block is passed to the exit() method.< / strong > < / li >
@ -1781,7 +1781,7 @@ CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs-
< / ul >
< div > < h2 id = "operator" > < a href = "#operator" name = "operator" > #< / a > Operator< / h2 > < p > < strong > Module of functions that provide the functionality of operators. Functions are ordered by operator precedence, starting with least binding.< / strong > < / p > < pre > < code class = "python language-python hljs" > < span class = "hljs-keyword" > import< / span > operator < span class = "hljs-keyword" > as< / span > op
< bool> = op.not_(< obj> ) < span class = "hljs-comment" > # or, and, not (or/and missing)< / span >
< bool> = op.eq/ne/lt/le/gt/ge/contains/is_ (< obj> , < obj> ) < span class = "hljs-comment" > # ==, !=, < , < =, > , > =, in, is < / span >
< bool> = op.eq/ne/lt/le/gt/ge/is_/ contains(< obj> , < obj> ) < span class = "hljs-comment" > # ==, !=, < , < =, > , > =, is, in < / span >
< obj> = op.or_/xor/and_(< int/set> , < int/set> ) < span class = "hljs-comment" > # |, ^, & < / span >
< int> = op.lshift/rshift(< int> , < int> ) < span class = "hljs-comment" > # < < , > > < / span >
< obj> = op.add/sub/mul/truediv/floordiv/mod(< obj> , < obj> ) < span class = "hljs-comment" > # +, -, *, /, //, %< / span >
@ -2190,7 +2190,7 @@ $ snakeviz test.prof <span class="hlj
< view> = < array> .transpose() < span class = "hljs-comment" > # Or: < array> .T< / span >
< / code > < / pre >
< pre > < code class = "python language-python hljs" > < array> = np.copy/abs/sqrt/log/int64(< 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> = < array> .sum/max/mean/argmax/all(axis) < span class = "hljs-comment" > # Aggregates specified dimension .< / span >
< array> = np.apply_along_axis(< func> , axis, < array> ) < span class = "hljs-comment" > # Func can return a scalar or array.< / span >
< / code > < / pre >
< pre > < code class = "python language-python hljs" > < array> = np.concatenate(< list_of_arrays> , axis=< span class = "hljs-number" > 0< / span > ) < span class = "hljs-comment" > # Links arrays along first axis (rows).< / span >