<commit_before>import numpy as N
#from scipy.stats import norm, median
#from scipy.stats.stats import nanmedian,_nanmedian
 	
def MAD(a, c=0.6745, axis=0):
    """
    Median Absolute Deviation along given axis of an array:

    median(abs(a - median(a))) / c

    """

    good = (a==a)
    a = N.asarray(a, N.float64)
    if a.ndim == 1:
        d = N.median(a[good])
        m = N.median(N.fabs(a[good] - d) / c)
    else:
        d = N.median(a[good], axis=axis)
        # I don't want the array to change so I have to copy it?
        if axis > 0:
            aswp = swapaxes(a[good],0,axis)
        else:
            aswp = a[good]
        m = N.median(N.fabs(aswp - d) / c, axis=0)

    return m

def nanmedian(arr):
    """
    Returns median ignoring NAN<commit_msg>mad documentation minor update<commit_after>import numpy as N
#from scipy.stats import norm, median
#from scipy.stats.stats import nanmedian,_nanmedian
 	
def MAD(a, c=0.6745, axis=0):
    """
    Median Absolute Deviation along given axis of an array:

    median(abs(a - median(a))) / c

    c = 0.6745 is the constant to convert from MAD to std; it is used by
    default

    """

    good = (a==a)
    a = N.asarray(a, N.float64)
    if a.ndim == 1:
        d = N.median(a[good])
        m = N.median(N.fabs(a[good] - d) / c)
    else:
        d = N.median(a[good], axis=axis)
        # I don't want the array to change so I have to copy it?
        if axis > 0:
            aswp = swapaxes(a[good],0,axis)
        else:
            aswp = a[good]
        m = N.median(N.fabs(aswp - d) / c, axis=0)

    return m

def nanmedian(arr):
    """
    Returns median ignoring NAN
{'fraction_non_alphanumeric': 0.13127646702964307, 'fraction_numerical': 0.017543859649122806, 'mean_word_length': 2.103189493433396, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3246649', 'n_tokens_mistral': 644, 'n_tokens_neox': 599, 'n_words': 180}