On numpy.pad(array, pad_width, mode, **kwargs)

Virgil Stokes <[email protected]>
Newsgroups gmane.comp.python.scientific.user
Message-ID <[email protected]>
One mode of padding is 'mean'.  However, it does not return the actual mean of the array --- it returns the rounded value of the mean!

example:

    a = np.array([1, 2, -1, 4, -3])
  np.mean(a) =  0.6
  np.pad(a, (2,), 'mean') = [ 1  1  1  2 -1  4 -3  1  1]

The documentation that I found at: https://docs.scipy.org/doc/numpy/reference/generated/numpy.pad.html
shows:

‘mean’ - Pads with the mean value of all or part of the vector along each axis.

It actually Pads with the rounded mean value. IMHO it should return the "float_" value. If the SciPy team does not agree, then the documentation should be changed to show what it actually returns.

--V




IMHO it should








När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here: http://www.uu.se/en/about-uu/data-protection-policy

_______________________________________________
SciPy-User mailing list
[email protected]
https://mail.python.org/mailman/listinfo/scipy-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.