We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See:
In [27]: str(pd.Timestamp(200)) Out[27]: '1970-01-01 00:00:00' In [28]: repr(pd.Timestamp(200)) Out[28]: "Timestamp('1970-01-01 00:00:00.000000200', tz=None)"
whereas microseconds work fine:
In [30]: str(pd.Timestamp(2000)) Out[30]: '1970-01-01 00:00:00.000002'
The text was updated successfully, but these errors were encountered:
One way to fix this would be to implement isoformat in Timestamp. Another would be to implement __str__ and have that method check if nanos !=0.
isoformat
__str__
Sorry, something went wrong.
def isoformat(self, sep='T'): base = super(_Timestamp, self).isoformat(sep=sep) if self.nanosecond == 0: return base if self.tzinfo is not None: base1, base2 = base[:-6], base[-6:] else: base1, base2 = base, "" if self.microsecond != 0: base1 += "%.3d" % self.nanosecond else: base1 += "%.9d" % self.nanosecond return base1 + base2
I intend to fix this (and add some test showing issue) in #5701
Successfully merging a pull request may close this issue.
See:
whereas microseconds work fine:
The text was updated successfully, but these errors were encountered: