0

I have a column of dates, I'm trying to figure out what is the earliest date of the table and then insert a row above it with certain values. I'm using petl but can't seem to figure out how to use min on a column of date values. Is that even doable?

  • did you try using min(df['date_column']) – user3687197 Jun 07 '18 at 21:06
  • If the values are dates of any standard supported type, merely use the vector operation `min` on the column. @user3687197 gave you one such suggestion. If the dates are *not* in a standard type, convert them to Python's `datetime` or equivalent type. – Prune Jun 07 '18 at 21:12
  • Actually not using `pandas`, does df still work with vanilla python? –  Jun 07 '18 at 21:22

0 Answers0