NumPy: calculate averages with NaNs removed

前端 未结 12 2512
慢半拍i
慢半拍i 2020-11-27 18:45

How can I calculate matrix mean values along a matrix, but to remove nan values from calculation? (For R people, think na.rm = TRUE).

Here

12条回答
  •  Happy的楠姐
    2020-11-27 19:22

    Assuming you've also got SciPy installed:

    http://www.scipy.org/doc/api_docs/SciPy.stats.stats.html#nanmean

提交回复
热议问题