title: Extract all values in a certain year of a pandas DataFrame
body: <p>I want to obtain all values that have a certain year in the following pandas <code>DataFrame</code> instance:</p>
  
  <pre><code>timestamps = np.array([pd.Timestamp('2016-01-01'), pd.Timestamp('2016-01-02'), pd.Timestamp('2017-01-01'), pd.Timestamp('2018-01-01')])
  quantities = np.array([1.0, 10.0, 2.0, 3.0])
  data = dict(timestamps=timestamps, quantities=quantities)
  df = pd.DataFrame(data=data)
  </code></pre>
  
  <p>which looks like this:</p>
  
  <pre><code>  timestamps  quantities
  0 2016-01-01         1.0
  2 2016-01-02         10.0
  3 2017-01-01         2.0
  4 2018-01-01         3.0
  </code></pre>
  
  <p>I want to extract all the <code>quantities</code> attribute that have a certain year, i.e. for 2016 I would get [1.0, 10.0]?</p>