title: How to calculate mean values for a particular column in dataframe?
body: <p>I have a dataframe which has values of type: <code>object</code>. Dataframe also contains <code>NaN</code> values. I want to ignore <code>NaN</code> values and for all the remaining values in the column, I want to calculate the mean.</p>
  
  <p>Mean is calculated as follows:
  Upperbound value = 30
  Lowerbound value = 0</p>
  
  <p>(Upperbound and lowerbound are fixed and all values need to be calculated wrt to them.)</p>
  
  <p>So,</p>
  
  <ul>
  <li><p>for '>20', mean = (20+30)/2 = 25</p></li>
  <li><p>for '>1', mean = (30+1)/2=15.5</p></li>
  <li><p>for '&lt;5', mean = (5+0)/2 = 2.5</p></li>
  <li><p>for '&lt;10', mean = (10+0)/2 = 5 </p></li>
  </ul>
  
  <p>Dataframe:</p>
  
  <pre><code>column1
  &gt;20
  NaN
  &lt;5
  12
  &gt;1
  &lt;10
  NaN
  8
  </code></pre>
  
  <p><strong>Note:</strong> Above values in the column are strings and I want to convert it to numerical value.</p>
  
  <p>Final converted dataframe should be:</p>
  
  <pre><code>column1
  25
  NaN
  2.5
  12
  15.5
  5
  NaN
  8
  </code></pre>
  
  <p>Note: Above values like 8 and 12 are not converted I only want to convert those values which are prefixed with either > or &lt; remaining values just need to be converted to numerical from the string value.</p>