簡體   English   中英

我如何只得到時間,沒有日期?

[英]how Do i get the time only, no date?

您好,我正在使用pandas to_datetime轉換數據幀中的數據列,但在這種情況下,我只希望時間部分(小時和分鍾),我不希望日期。

這是我的代碼:

converted_air_time = pd.to_datetime(flight_data["AirTime"], unit = "s")
print converted_air_time
Output: 0        1970-01-01 00:02:12

我只想要00:02:12部分

如果有人知道請協助謝謝

print converted_air_time.strftime('%H:%M:%S')

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM