|
From: Jerzy K. <jer...@un...> - 2014-09-16 16:09:43
|
Le 16/09/2014 17:31, Xiaobo Yang a écrit : > My X axis represents dates. When I used get_xlim(), I got something > like 735461.0 and 735490.5. What are these values? How can I convert > to python date objects? Please, read the documentation of datetime. Your data are *ordinals*, numbers which pack the data: year, month, etc. into one number ; the same strategy is used in spreadsheets, e.g., Excel. If r=r=735461, then datetime.fromordinal(r) gives: datetime.datetime(2014, 8, 16, 0, 0), unless I am mistaken... == This is the first approximation ... the "proleptic Gregorian ordinals" are integers. You have floats, and this probably is converted into fractions of a day / hour, etc. Read also something about timestamps. Regards. Jerzy Karczmarczuk |