-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
While numpy.mean
works fine with astropy.units.Quantity
, numpy.average
does not.
In [1]: import numpy as np
In [2]: import astropy.units as u
In [3]: a = np.linspace(0, 1, 10) * u.meter
In [4]: np.mean(a)
Out[4]: <Quantity 0.5 m>
In [5]: np.average(a)
Out[5]: 0.5
In [6]: b = np.linspace(0, 1, 10) * u.centimeter
In [7]: np.average(a) == np.average(b)
Out[7]: True