擅长:python、mysql、java
<p>您应该更改<code>ts_failure</code>的表示形式:</p>
<pre><code>ts_failure = pd.to_datetime(pd.Timestamp(2019, 5, 15, 19, 48, 2, 495000))
df.iloc[df.set_index('Timestamp').index.get_loc(ts_failure, method='nearest')]
Timestamp 2019-05-15 19:48:02.479
Name: 2, dtype: datetime64[ns]
</code></pre>
<p>请注意,时间戳总是以纳秒为单位。所以把时间戳的最后一个值乘以1000。你知道吗</p>