Hello,
I was trying to determine the first_valid_index of a pandas.Series using, pandas 0.8.2.dev-4083689. The answer that I should have received was:
1983-05-09 00:00:00.
However, the answer that I did receive was1905-05-30 09:45:04.680312
The problem appears to be in pandas.lib.Timestamp. In the DatetimeIndex class the __getitem__ method has a line of code:
return Timestamp(val, offset=self.offset, tz=
self.tz)
which is returning the wrong value. The code below reproduces the problem.
import pandas
import numpy as np
print 'using pandas: ', pandas.__version__
print 'using numpy:', np.__version__
d = np.datetime64('1983-05-19T20:00:00.000000000-0400')
ts = pandas.lib.Timestamp(d)
print 'numpy.datetime64:', d
print 'Timestamp:', ts
Anyway, here the results:
using pandas: 0.8.2.dev-4083689
using numpy: 1.7.0.dev-0c5f480
numpy.datetime64: 1983-05-19T20:00:00.000000000-0400
Timestamp: 1905-05-30 09:45:04.680312
I am doing something wrong or should I file this as a bug?
--
Aquil H. Abdullah
"I never think of the future. It comes soon enough" - Albert Einstein