Element wise squaring of array-likes and sparse matrices.
Whether to create a copy of X and operate on it or to perform inplace computation (default behaviour).
Return the element-wise square of the input.
>>> from sklearn.utils import safe_sqr >>> safe_sqr([1, 2, 3]) array([1, 4, 9])
© 2007–2025 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/1.6/modules/generated/sklearn.utils.safe_sqr.html