def _handle_zeros_in_scale(scale, copy=True):

    # if we are fitting on 1D arrays, scale might be a scalar
    if np.isscalar(scale):
        if scale == .0:
            scale = 1.
        return scale
    elif isinstance(scale, np.ndarray):
        if copy:
            # New array to avoid side-effects
            scale = scale.copy()
        scale[scale == 0.0] = 1.0
        return scale
Makes sure that whenever scale is zero, we handle it correctly.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/preprocessing/data.py/_handle_zeros_in_scale