title: Plotting mean as dashed line on histogram with matplotlib
body: <p>I have a histogram created from a pandas dataframe that I would like to plot a vertical dashed line representing the mean of the dataset. I have reviewed <a href="https://stackoverflow.com/questions/16180946/drawing-average-line-in-histogram-matplotlib">this thread</a>, which is exactly the style I am looking for, however, I cannot figure out how to make it work with my code (below):</p>
  
  <pre><code>import pandas as pd
  import matplotlib.pyplot as plt
  
  #import csv file into pandas dataframe
  df = pd.read_csv('/path/to/my/file')
  
  #calculating mean
  m = df.mean()
  #print(m)
  
  #plotting histogram 
  df.plot(kind='hist')
  #plt.axvline(m, color = 'r', linestyle = 'dashed', linewidth = 2)
  </code></pre>
  
  <p>I end up receiving this error:</p>
  
  <pre><code> ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
  </code></pre>
  
  <p>Not sure what that means, any help would be appreciated. </p>
  
  <p>EDIT: My datafile is a csv with one column, first row is a header (string) and all subsequent 107 rows are values ranging from app. 1.0E+11 to 4.0E+11</p>
  
  <hr>
  
  <p>Fake data (Python 2.7)</p>
  
  <pre><code>import io
  import numpy as np
  a = np.linspace(1, 4, num = 20)
  s = 'E11\n'.join(map(str, a))
  s += 'E11'
  #print(s)
  df = pd.read_csv(io.BytesIO(s))
  </code></pre>