擅长:python、mysql、java
<p>我不这么认为。在</p>
<p>但您可以将这两列转换为datetime,然后得到差异。日期是一些所以只得到时间差。最后,您可以通过<a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.dt.seconds.html" rel="nofollow noreferrer">^{<cd1>}</a>或<a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.dt.total_seconds.html" rel="nofollow noreferrer">^{<cd2>}</a>将差异转换为秒(如果可能<code>time1 < time2</code>):</p>
<pre><code>df['diff'] = (pd.to_datetime(df['time1']) -
pd.to_datetime(df['time2']))
</code></pre>
<p>样品:</p>
^{pr2}$