rt_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)
  * __
  * [ Functions ](../functions.html)
  * polars.datet... 

#  polars.datetime_range  #

polars.  datetime_range  (

     _ start  :  datetime  |  date  |  IntoExprColumn  _ , 
     _ end  :  datetime  |  date  |  IntoExprColumn  _ , 
     _ interval  :  [ str  ](https://docs.python.org/3/library/stdtypes.html#str "\(in Python v3.12\)") |  timedelta  =  '1d'  _ , 
     _ *  _ , 
     _ closed  :  ClosedInterval  =  'both'  _ , 
     _ time_unit  :  TimeUnit  |  [ None  ](https://docs.python.org/3/library/constants.html#None "\(in Python v3.12\)") =  None  _ , 
     _ time_zone  :  [ str  ](https://docs.python.org/3/library/stdtypes.html#str "\(in Python v3.12\)") |  [ None  ](https://docs.python.org/3/library/constants.html#None "\(in Python v3.12\)") =  None  _ , 
     _ eager  :  [ bool  ](https://docs.python.org/3/library/functions.html#bool "\(in Python v3.12\)") =  False  _ , 
)  →  Series  |  Expr  [ [source]  ](https://github.com/pola-rs/polars/blob/main/py-polars/polars/functions/range/datetime_range.py#L62-L193) # 
    

Generate a datetime range.

Parameters  :

    

**start**

    

Lower bound of the datetime range.

**end**

    

Upper bound of the datetime range.

**interval**

    

Interval of the range periods, specified as a Python ` timedelta  ` object or
using the Polars duration string language (see “Notes” section below).

**closed** {‘both’, ‘left’, ‘right’, ‘none’}

    

Define which sides of the range are closed (inclusive).

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

    

Time unit of the resulting ` Datetime  ` data type.

**time_zone**

    

Time zone of the resulting ` Datetime  ` data type.

**eager**

    

Evaluate immediately and return a ` Series  ` . If set to ` False  `
(default), return an expression instead.

Returns  :

    

Expr or Series

    

Column of data type ` Datetime  ` .

Notes

` interval  ` is created according to the following string language:

  * 1ns (1 nanosecond) 

  * 1us (1 microsecond) 

  * 1ms (1 millisecond) 

  * 1s (1 second) 

  * 1m (1 minute) 

  * 1h (1 hour) 

  * 1d (1 calendar day) 

  * 1w (1 calendar week) 

  * 1mo (1 calendar month) 

  * 1q (1 calendar quarter) 

  * 1y (1 calendar year) 

Or combine them: “3d12h4m25s” # 3 days, 12 hours, 4 minutes, and 25 seconds

By “calendar day”, we mean the corresponding time on the next day (which may
not be 24 hours, due to daylight savings). Similarly for “calendar week”,
“calendar month”, “calendar quarter”, and “calendar year”.

Exam