# Nan value of Mean in histogram

**URL:** <https://root-forum.cern.ch/t/nan-value-of-mean-in-histogram/48678>\
**Category:** Newbie\
**Created:** [February 6, 2022, 8:42pm UTC](https://root-forum.cern.ch/t/nan-value-of-mean-in-histogram/48678 "2022-02-06T20:42:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sima\_Bashiri](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sima_bashiri/32/22156_2.png) [@Sima\_Bashiri](https://root-forum.cern.ch/u/Sima_Bashiri)\
**Post date:** [February 6, 2022, 8:42pm UTC](https://root-forum.cern.ch/t/nan-value-of-mean-in-histogram/48678/1 "2022-02-06T20:42:27Z")

</div>

Hi,  
I have a question about one of my drawn histograms.  
What’s the reason for `nan` value of `Mean` as you see? What I understand from the shape of this hist, the mean must be around -0.3, but I don’t know why it shows Nan value to me.  
Hist has been drawn using TH1D class.  
 ![image](https://root-forum.cern.ch/uploads/default/original/3X/a/c/ac77c638d8f21852c2e7978fcee2ff47caf6ff75.png)

Thanks in advance

* * *

_ROOT Version:_ 6.22

* * *

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 6, 2022, 8:47pm UTC](https://root-forum.cern.ch/t/nan-value-of-mean-in-histogram/48678/2 "2022-02-06T20:47:14Z")

</div>

When filling the histogram, make sure that you do not try to fill (some bins) with “nan”.

You could also try now: `h_cos1ee->ResetStats();`
