daft.functions.day_of_year#
day_of_year #
day_of_year(expr: Expression) -> Expression
Retrieves the ordinal day for a datetime column. Starting at 1 for January 1st and ending at 365 or 366 for December 31st.
Returns:
| Name | Type | Description |
|---|---|---|
Expression | Expression | a UInt32 expression with just the day_of_year extracted from a datetime column |
Examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
╭─────────────────────┬─────────────╮
│ datetime ┆ day_of_year │
│ --- ┆ --- │
│ Timestamp[us] ┆ UInt32 │
╞═════════════════════╪═════════════╡
│ 2024-01-01 00:00:00 ┆ 1 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ 2024-02-01 00:00:00 ┆ 32 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ 2024-12-31 00:00:00 ┆ 366 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ 2023-12-31 00:00:00 ┆ 365 │
╰─────────────────────┴─────────────╯
(Showing first 4 of 4 rows) Source code in daft/functions/datetime.py
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | |