Convert Matplotlib dates to `~datetime.datetime` objects. Parameters ---------- x : float or sequence of floats Number of days (fraction part represents hours, minutes, seconds) since the epoch. See `.get_epoch` for the epoch, which can be changed by :rc:`d
(x, tz=None)
| 453 | |
| 454 | |
| 455 | def num2date(x, tz=None): |
| 456 | """ |
| 457 | Convert Matplotlib dates to `~datetime.datetime` objects. |
| 458 | |
| 459 | Parameters |
| 460 | ---------- |
| 461 | x : float or sequence of floats |
| 462 | Number of days (fraction part represents hours, minutes, seconds) |
| 463 | since the epoch. See `.get_epoch` for the |
| 464 | epoch, which can be changed by :rc:`date.epoch` or `.set_epoch`. |
| 465 | tz : str or `~datetime.tzinfo`, default: :rc:`timezone` |
| 466 | Timezone of *x*. If a string, *tz* is passed to `dateutil.tz`. |
| 467 | |
| 468 | Returns |
| 469 | ------- |
| 470 | `~datetime.datetime` or sequence of `~datetime.datetime` |
| 471 | Dates are returned in timezone *tz*. |
| 472 | |
| 473 | If *x* is a sequence, a sequence of `~datetime.datetime` objects will |
| 474 | be returned. |
| 475 | |
| 476 | Notes |
| 477 | ----- |
| 478 | The Gregorian calendar is assumed; this is not universal practice. |
| 479 | For details, see the module docstring. |
| 480 | """ |
| 481 | tz = _get_tzinfo(tz) |
| 482 | return _from_ordinalf_np_vectorized(x, tz).tolist() |
| 483 | |
| 484 | |
| 485 | _ordinalf_to_timedelta_np_vectorized = np.vectorize( |
no test coverage detected
searching dependent graphs…