Create date_range with predefined number of periods in polars

  Kiến thức lập trình

When I create a date range in pandas, I often use the periods argument. Something like this:

pd.date_range(start='1/1/2018', periods=8)
DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04',
               '2018-01-05', '2018-01-06', '2018-01-07', '2018-01-08'],
              dtype='datetime64[ns]', freq='D')

What would be the equivalent way in polars? I am missing the periods input parameter in pl.date_range.

Having said that, there’s probably an easy and clever solution 😉

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT