t_frame_equal.html)
    * [ polars.testing.assert_frame_not_equal ](../../api/polars.testing.assert_frame_not_equal.html)
    * [ polars.testing.assert_series_equal ](../../api/polars.testing.assert_series_equal.html)
    * [ polars.testing.assert_series_not_equal ](../../api/polars.testing.assert_series_not_equal.html)
    * [ polars.testing.parametric.dataframes ](../../api/polars.testing.parametric.dataframes.html)
    * [ polars.testing.parametric.series ](../../api/polars.testing.parametric.series.html)
    * [ polars.testing.parametric.column ](../../api/polars.testing.parametric.column.html)
    * [ polars.testing.parametric.columns ](../../api/polars.testing.parametric.columns.html)
    * [ polars.testing.parametric.create_list_strategy ](../../api/polars.testing.parametric.create_list_strategy.html)
    * [ polars.testing.parametric.load_profile ](../../api/polars.testing.parametric.load_profile.html)
    * [ polars.testing.parametric.set_profile ](../../api/polars.testing.parametric.set_profile.html)

  * [ Metadata ](../../metadata.html) __
    * [ polars.build_info ](../../api/polars.build_info.html)
    * [ polars.get_index_type ](../../api/polars.get_index_type.html)
    * [ polars.show_versions ](../../api/polars.show_versions.html)
    * [ polars.thread_pool_size ](../../api/polars.thread_pool_size.html)
    * [ polars.threadpool_size ](../../api/polars.threadpool_size.html)

  * [ __ ](../../../index.html)
  * [ Python API reference ](../../index.html)
  * __
  * [ Temporal ](../temporal.html)
  * polars.Expr.... 

#  polars.Expr.dt.combine  #

Expr.dt.  combine  (  _ time  :  dt.time  |  Expr  _ , _ time_unit  :  TimeUnit  =  'us'  _ )  →  Expr  [ [source]  ](https://github.com/pola-rs/polars/blob/main/py-polars/polars/expr/datetime.py#L494-L552) # 
    

Create a naive Datetime from an existing Date/Datetime expression and a Time.

If the underlying expression is a Datetime then its time component is
replaced, and if it is a Date then a new Datetime is created by combining the
two values.

Parameters  :

    

**time**

    

A python time literal or polars expression/column that resolves to a time.

**time_unit** {‘ns’, ‘us’, ‘ms’}

    

Unit of time.

Examples

    
    
    >>> from datetime import datetime, date, time
    >>> df = pl.DataFrame(
    ...     {
    ...         "dtm": [
    ...             datetime(2022, 12, 31, 10, 30, 45),
    ...             datetime(2023, 7, 5, 23, 59, 59),
    ...         ],
    ...         "dt": [date(2022, 10, 10), date(2022, 7, 5)],
    ...         "tm": [time(1, 2, 3, 456000), time(7, 8, 9, 101000)],
    ...     }
    ... )
    >>> df
    shape: (2, 3)
    ┌─────────────────────┬────────────┬──────────────┐
    │ dtm                 ┆ dt         ┆ tm           │
    │ ---                 ┆ ---        ┆ ---          │
    │ datetime[μs]        ┆ date       ┆ time         │
    ╞═════════════════════╪════════════╪══════════════╡
    │ 2022-12-31 10:30:45 ┆ 2022-10-10 ┆ 01:02:03.456 │
    │ 2023-07-05 23:59:59 ┆ 2022-07-05 ┆ 07:08:09.101 │
    └─────────────────────┴────────────┴──────────────┘
    >>> df.select(
    ...     [
    ...         pl.col("dtm").dt.combine(pl.col("tm")).alias("d1"),
    ...         pl.col("dt").dt.combine(pl.col("tm")).alias("d2"),
    ...         pl.col("dt").dt.combine(time(4, 5, 6)).alias("d3"),
    ...     ]
    ... )
    shape: (2, 3)
    ┌─────────────────────────┬─────────────────────────┬─────────────────────┐
    │ d1                      ┆ d2                      ┆ d3                  │
    │ ---                     ┆ ---                     ┆ ---                 │
    │ datetime[μs]            ┆ datetime[μs]            ┆ datetime[μs]        │
    ╞═════════════════════════╪═════════════════════════╪═════════════════════╡
    │ 2022-12-31 01:02:03.456 ┆ 2022-10-10 01:02:03.456 ┆ 2022-10-10 04:05:06 │
    │ 2023-07-05 07:08:09.101 ┆ 2022-07-05 07:08:09.101 ┆ 2022-07-05 04:05:06 │
    └─────────────────────────┴─────────────────────