title: Check if value is equal to 0 for mixed type column (with timedelta and floats)
body: <p>Let's say we have the following dataframe. Which in real case is an comparison of columns after melting, that's the reason there are mixed types.</p>
  
  <pre><code>df = pd.DataFrame({'value':[0.0, 0.0, pd.Timedelta(hours=1), pd.Timedelta(0)]})
  
               value
  0                0
  1                0
  2  0 days 01:00:00
  3  0 days 00:00:00
  </code></pre>
  
  <p>What I wanted to do, is to check if this is equal to <code>0</code> and based on that make a conditional column.</p>
  
  <p>So first we have a to get a boolean to mark which rows are 0.
  Simply using <code>eq</code> or <code>==</code>, wont work:</p>
  
  <pre><code>df['value'].eq(0)
  
  0     True
  1     True
  2    False
  3    False
  Name: value, dtype: bool
  </code></pre>
  
  <p>This is because we have a <code>Timedelta</code> type probably, so I thought lets convert the timedelta to seconds. So I checked with:</p>
  
  <pre><code>df['value'].apply(type) == pd._libs.tslibs.timedeltas.Timedelta
  
  0    False
  1    False
  2     True
  3     True
  Name: value, dtype: bool
  </code></pre>
  
  <p>Which works.</p>
  
  <p>Then used, which did not work:</p>
  
  <pre><code>np.where(df['value'].apply(type) == pd._libs.tslibs.timedeltas.Timedelta, 
           df['value'].total_seconds(), 
           df['value'])
  
  'Series' object has no attribute 'total_seconds'
  </code></pre>
  
  <p>Finally, <strong>this works</strong>. </p>
  
  <pre><code>df['value'].apply(lambda x: x.total_seconds() if type(x) == pd._libs.tslibs.timedeltas.Timedelta else x).eq(0)
  
  0     True
  1     True
  2    False
  3     True
  Name: value, dtype: bool
  </code></pre>
  
  <p>But it's quite slow and does not look <em>"panda like"</em>.</p>
  
  <p>So my <strong>question</strong> is, is this there a faster more optimal solution?</p>