Skip to content

Commit f2587fd

Browse files
committed
DOC: add td64 example in np.mean
1 parent 0273e05 commit f2587fd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

numpy/_core/fromnumeric.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3884,6 +3884,11 @@ def mean(a, axis=None, dtype=None, out=None, keepdims=np._NoValue, *,
38843884
>>> np.mean(a, dtype=np.float64)
38853885
0.55000000074505806 # may vary
38863886
3887+
Computing the mean in timedelta64 is available:
3888+
>>> b = np.array([np.timedelta64(1,'D'), np.timedelta64(3,'D')])
3889+
>>> np.mean(b)
3890+
2 days
3891+
38873892
Specifying a where argument:
38883893
38893894
>>> a = np.array([[5, 9, 13], [14, 10, 12], [11, 15, 19]])

0 commit comments

Comments
 (0)