How to use the xskillscore.pearson_r_p_value function in xskillscore

To help you get started, we’ve selected a few xskillscore examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bradyrx / climpred / climpred / metrics.py View on Github external
+-----------------+-----------+

    See also:
        * xskillscore.pearson_r
        * xskillscore.pearson_r_p_value
        * climpred.pearson_r
        * climpred.pearson_r_eff_p_value
    """
    weights = metric_kwargs.get('weights', None)
    skipna = metric_kwargs.get('skipna', False)
    # p value returns a runtime error when working with NaNs, such as on a climate
    # model grid. We can avoid this annoying output by specifically suppressing
    # warning here.
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        return pearson_r_p_value(
            forecast, verif, dim=dim, weights=weights, skipna=skipna
        )