2

Given a date like 8300 BCE, I run pd.to_datetime("-8300", format="%y").

This produces ValueError: time data '-8300' does not match format '%y' (match).

Is there a way to handle "negative" dates in Pandas?

zadrozny
  • 1,631
  • 3
  • 22
  • 27

1 Answers1

0

Yes,

I hope this answer helps.

There is a procedure given in documentation for Julian dates, you can find that here. Focus on unit & origin arguments

Ajay A
  • 1,030
  • 1
  • 7
  • 19
  • Can you provide an example? `pd.to_datetime("1970", unit="D", origin="julian")` produces `ValueError: incompatible 'arg' type for given 'origin'='julian'`. If I make 1970 an int rather than str, I get `OutOfBoundsDatetime`. – zadrozny Sep 15 '20 at 22:05