0

I'd like to find the number of months between today and a date field in a python polars dataframe.
How do you do that?

(datetime.today() - pl.col('mydate')).dt.days()

returns it only in days.

lmocsi
  • 550
  • 2
  • 17
  • How do you define that difference (28 days, 30 days, 31 days)? What should be the difference between 21 July 2023 and 1 August 2023, for example? See if [this](https://stackoverflow.com/a/4040338/9857631) is what you need. – not_speshal Aug 08 '23 at 16:02

0 Answers0