Method: Polars::Functions#datetime_ranges
- Defined in:
- lib/polars/functions/range/datetime_range.rb
permalink #datetime_ranges(start, stop, interval: "1d", closed: "both", time_unit: nil, time_zone: nil, eager: false) ⇒ Object
Create a column of datetime ranges.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/polars/functions/range/datetime_range.rb', line 119 def datetime_ranges( start, stop, interval: "1d", closed: "both", time_unit: nil, time_zone: nil, eager: false ) interval = Utils.parse_interval_argument(interval) if time_unit.nil? && interval.include?("ns") time_unit = "ns" end start_rbexpr = Utils.parse_into_expression(start) end_rbexpr = Utils.parse_into_expression(stop) result = Utils.wrap_expr( Plr.datetime_ranges( start_rbexpr, end_rbexpr, interval, closed, time_unit, time_zone ) ) if eager return Polars.select(result).to_series end result end |