title: Pandas Dataframe - find the row with minimum value based on two columns but greater than 0
body: <p>I have a dataframe with 3 columns: x, y, time. There are a few thousand rows.</p>
  
  <p>What I want to do is retrieve the row with the minimum time but I would like that the minimum should not be 0. </p>
  
  <p>e.g. </p>
  
  <pre><code>x     y    time
  240   1    28.5
  240   2    19.3
  240   240     0
  240   19    9.7
  </code></pre>
  
  <p>So far what I've tried were the following:</p>
  
  <pre><code>df.loc[df['time'] &gt; 0].min()
  # this gives me a series and I want a row
  # x    225.000000
  # y      0.000000
  # time   1.066606
  
  df['time'].drop_duplicates().nsmallest(1)
  # 225    0.0
  </code></pre>
  
  <p>I have also tried something with groupby as well</p>
  
  <pre><code>df.loc[df.groupby('id_x', sort=False)['time'].idxmin()]
  </code></pre>
  
  <p>I know had problems subsetting this one as I usually got a series. </p>