Skip to content

Commit 32a2304

Browse files
authored
Merge pull request numpy#27168 from guan404ming/mean-td64-doc
DOC: add td64 example in `np.mean`
2 parents 0273e05 + 03460b1 commit 32a2304

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

numpy/_core/fromnumeric.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3884,6 +3884,12 @@ 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+
3889+
>>> b = np.array([1, 3], dtype="timedelta64[D]")
3890+
>>> np.mean(b)
3891+
np.timedelta64(2,'D')
3892+
38873893
Specifying a where argument:
38883894
38893895
>>> a = np.array([[5, 9, 13], [14, 10, 12], [11, 15, 19]])

0 commit comments

Comments
 (0)