<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _normalize_for_correlation(data, axis, return_nans=False):
 """normalize the data before computing correlation The data will be z-scored and divided by sqrt(n) along the assigned axis Parameters data: 2D array axis: int specify which dimension of the data should be normalized return_nans: bool, default:False If False, return zeros for NaNs; if True, return NaNs Returns ------- data: 2D array the normalized data """

    shape = data.shape
    data = zscore(data, axis=axis, ddof=0)
    # if zscore fails (standard deviation is zero),
    # optionally set all values to be zero
    if not return_nans:
        data = np.nan_to_num(data)
    data = data / math.sqrt(shape[axis])
    return data