Closed
Description
Substituting a NaT
timedelta or datetime into an f-string seems to throw an error. Calling str()
on the object beforehand seems to fix the issue.
Reproducing code example:
import numpy as np
x = np.timedelta64('NaT', 'ns')
f"{x}"
Error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
NumPy/Python version information:
In [5]: print(sys.version)
3.7.8 | packaged by conda-forge | (default, Jul 31 2020, 02:25:08)
[GCC 7.5.0]
In [6]: print(numpy.__version__)
1.19.1