pydata/pandas — pull request #6391 by ischwabacher (2014-02-18 00:53:19+00:00)
Title: BUG: Fix behavior of `to_offset` with leading zeroes

Currently, `pandas.tseries.frequencies.to_offset` erroneously returns a zero time offset when the first part of its argument has a numerical value of zero, even if later parts have nonzero values. For instance,

In [123]: pandas.tseries.frequencies.to_offset('00H 00T 01S')
Out[123]: <0 * Days>

This change checks the sign of the numeric part of the argument before converting to `int` in order to support offsets like `'-00H 00T 01S'`.