Conversation
|
@stevevarner Hi, For example: import numpy as np
a = np.array([1, 2, 3, float('NaN'), 5, 6])
b = np.array([1, 2, float('NaN'), 5, 6, 7])
c = numpy.stack((a,b))
numpy.nanmean(c, axis=0)
Out[1]: array([ 1. , 2. , 3. , 5. , 5.5, 6.5])
# versus:
(a+b)/2
Out[2]: array([ 1. , 2. , nan, nan, 5.5, 6.5])Am I missing something? |
|
We are wanting it to disregard all NaN values in the mean. |
|
That would mean that thunder images and series |
|
No....they would behave the same. numpy.nanmean ignores the NaN values just as what was implemented. |
|
Hi, from numpy import arange, float32
from bolt import array
x = arange(2*3*4).reshape(2, 3, 4).astype(float32)
b = array(x, sc, axis=(0,))
b.nanmean()gives the error: Any idea why? Thanks, |
|
Had an offline chat with @boazmohar about some of this. Given that the goal of For implementation, |
|
@freeman-lab @jwittenbach looking over code, there is a python 2/3 problem with specifying longs for counters in stats counter. http://python3porting.com/differences.html (see long) import sys
if sys.version_info < (3,):
long = int |
Adding changes to support nanmean, nammin, nanmax, etc.