Join the newly launched
Discord community for real-time discussions, peer support, and direct interaction with the Meridian team!
meridian.data.time_coordinates.normalize_date_interval
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
將日期間隔的表示方式正規化為 date
秒的元組。
meridian.data.time_coordinates.normalize_date_interval(
date_interval: meridian.data.time_coordinates.DateInterval
) -> tuple[datetime.date, datetime.date]
這裡的日期間隔是 [start_date, end_date)
的元組,其中:
start_date
包含值,但 end_date
不含此值。
- 兩者皆為多型態,可採用以下形式:
datetime.datetime
(只會使用日期元件)
datetime.date
(規格化形式)
np.datetime64
(只會使用日期元件)
str
(會以「YYYY-mm-dd」的格式剖析,否則會以擲回)
在所有情況下,指定的日期間隔都會正規化為 datetime.date
的元組。
Args |
date_interval
|
多型日期間隔,以便進行規格化。 |
傳回 |
代表 [start_date, end_date) 日期間隔的 date 元組。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-10 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-11-10 (世界標準時間)。"],[],["The function `normalize_date_interval` converts a date interval into a tuple of `datetime.date` objects. It accepts a polymorphic `date_interval` which can be a tuple containing `datetime.datetime`, `datetime.date`, `np.datetime64`, or a \"YYYY-mm-dd\" formatted `str`. It returns a tuple with `start_date` and `end_date`, where `start_date` is inclusive and `end_date` is exclusive. Only the date component is utilized for `datetime` and `np.datetime64`.\n"],null,[]]