title: Mean including nan values
body: <pre class="lang-py prettyprint-override"><code>import numpy as np
  import pandas as pd
      
  GFG_dict = { '2019': [10,20,30,40],'2020': [20,30,40,50],'2021': [30, np.NaN, np.NaN, 60],'2022':[40,50,60,70]}
      
  gfg = pd.DataFrame(GFG_dict)
      
  gfg['mean1'] = gfg.mean(axis = 1)
  
  gfg['mean2'] = gfg.loc[:,'2019':'2022'].sum(axis = 1)/4
  
  gfg
  </code></pre>
  <p>I want to get the average as in column mean2.</p>
  <p>How do I get the same result using: <code>.mean(axis =1)</code></p>