import warnings

import numpy as np


def nans_in_same_positions(*arrays):
    """
    Compares all provided arrays to see if they have NaNs in the same positions.
    """
    if len(arrays) == 0:
        return True
    for arr in arrays[1:]:
        if not (np.isnan(arrays[0]) == np.isnan(arr)).all():
            return False
    return True


def nanmeanw(arr, axis=None):
    """
    Computes nanmean without raising a warning in case of NaNs in the dataset
    """
    with warnings.catch_warnings():
        warnings.simplefilter("ignore", category=RuntimeWarning)
        return np.nanmean(arr, axis=axis)

[((481, 506), 'warnings.catch_warnings', 'warnings.catch_warnings', ([], {}), '()\n', (504, 506), False, 'import warnings\n'), ((516, 572), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {'category': 'RuntimeWarning'}), "('ignore', category=RuntimeWarning)\n", (537, 572), False, 'import warnings\n'), ((588, 614), 'numpy.nanmean', 'np.nanmean', (['arr'], {'axis': 'axis'}), '(arr, axis=axis)\n', (598, 614), True, 'import numpy as np\n'), ((260, 279), 'numpy.isnan', 'np.isnan', (['arrays[0]'], {}), '(arrays[0])\n', (268, 279), True, 'import numpy as np\n'), ((283, 296), 'numpy.isnan', 'np.isnan', (['arr'], {}), '(arr)\n', (291, 296), True, 'import numpy as np\n')]