Overflow datetime, ValueError: Out of bounds nanosecond timestamp: 9999-12-31 00:00:00, Release Candidate 0.12
We use 9999-12-31 as end of time while processing.  No issue with it in .10.1 or .11 release.  Was trying .12rc1 and ran into the issue where I can create a dataframe with 9999-12-31 00:00:00 but if an apply operation does the same, there is an overflow reported.

In [1]: import pandas as pd

In [2]: import datetime

In [3]: data = [("a{0}".format(i), 99991231, 20130715) for i in xrange(10)]

In [4]: data
Out[4]:
[('a0', 99991231, 20130715),
 ('a1', 99991231, 20130715),
 ('a2', 99991231, 20130715),
 ('a3', 99991231, 20130715),
 ('a4', 99991231, 20130715),
 ('a5', 99991231, 20130715),
 ('a6', 99991231, 20130715),
 ('a7', 99991231, 20130715),
 ('a8', 99991231, 20130715),
 ('a9', 99991231, 20130715)]

In [5]: df = pd.DataFrame(data)

In [6]:

In [6]: df
Out[6]:
    0         1         2
0  a0  99991231  20130715
1  a1  99991231  20130715
2  a2  99991231  20130715
3  a3  99991231  20130715
4  a4  99991231  20130715
5  a5  99991231  20130715
6  a6  99991231  20130715
7  a7  99991231  20130715
8  a8  99991231  20130715
9  a9  99991231  20130715
## In [8]: df.apply(lambda x: (x[0], datetime.datetime(9999,12,31),datetime.datetime(9999,12,31)), axis=1)

ValueError                                Traceback (most recent call last)
/home/ahanda/python/learning/src/<ipython-input-8-5b4db85f40d0> in <module>()
----> 1 df.apply(lambda x: (x[0], datetime.datetime(9999,12,31),datetime.datetime(9999,12,31)), axis=1)

/logs/tmp/taserv/pandasrc/lib/python2.7/site-packages/pandas-0.12.0rc1-py2.7-linux-x86_64.egg/pandas/core/frame.pyc in apply(self, func, axis, broadcast, raw, args, **kwds)
   4414                     return self._apply_raw(f, axis)
   4415                 else:
-> 4416                     return self._apply_standard(f, axis)
   4417             else:
   4418                 return self._apply_broadcast(f, axis)

/logs/tmp/taserv/pandasrc/lib/python2.7/site-packages/pandas-0.12.0rc1-py2.7-linux-x86_64.egg/pandas/core/frame.pyc in _apply_standard(self, func, axis, ignore_failures)
   4503             if axis == 1:
   4504                 result = result.T
-> 4505             result = result.convert_objects(copy=False)
   4506
   4507             return result

/logs/tmp/taserv/pandasrc/lib/python2.7/site-packages/pandas-0.12.0rc1-py2.7-linux-x86_64.egg/pandas/core/frame.pyc in convert_objects(self, convert_dates, convert_numeric, copy)
   1712         return self._constructor(self._data.convert(convert_dates=convert_dates,
   1713                                                     convert_numeric=convert_numeric,
-> 1714                                                     copy=copy))
   1715
   1716     #----------------------------------------------------------------------

/logs/tmp/taserv/pandasrc/lib/python2.7/site-packages/pandas-0.12.0rc1-py2.7-linux-x86_64.egg/pandas/core/internals.pyc in convert(self, _args, *_kwargs)
   1305
   1306     def convert(self, _args, *_kwargs):
-> 1307         return self.apply('convert', _args, *_kwargs)
   1308
   1309     def replace(self, _args, *_kwargs):

/logs/tmp/taserv/pandasrc/lib/python2.7/site-packages/pandas-0.12.0rc1-py2.7-linux-x86_64.egg/pandas/core/internals.pyc in apply(self, f, _args, *_kwargs)
   1267                 applied = f(blk, _args, *_kwargs)
   1268             else:
-> 1269                 applied = getattr(blk,f)(_args, *_kwargs)
   1270
   1271             if isinstance(applied,list):

/logs/tmp/taserv/pandasrc/lib/python2.7/site-packages/pandas-0.12.0rc1-py2.7-linux-x86_64.egg/pandas/core/internals.pyc in convert(self, convert_dates, convert_numeric, copy)
    721             values = self.iget(i)
    722
--> 723             values = com._possibly_convert_objects(values, convert_dates=convert_dates, convert_numeric=convert_numeric)
    724             values = _block_shape(values)
    725             items = self.items.take([i])

/logs/tmp/taserv/pandasrc/lib/python2.7/site-packages/pandas-0.12.0rc1-py2.7-linux-x86_64.egg/pandas/core/common.pyc in _possibly_convert_objects(values, convert_dates, convert_numeric)
   1108
   1109         else:
-> 1110             values = lib.maybe_convert_objects(values, convert_datetime=convert_dates)
   1111
   1112     # convert to numeric

/logs/tmp/taserv/pandasrc/lib/python2.7/site-packages/pandas-0.12.0rc1-py2.7-linux-x86_64.egg/pandas/lib.so in pandas.lib.maybe_convert_objects (pandas/lib.c:36583)()

/logs/tmp/taserv/pandasrc/lib/python2.7/site-packages/pandas-0.12.0rc1-py2.7-linux-x86_64.egg/pandas/tslib.so in pandas.tslib.convert_to_tsobject (pandas/tslib.c:12743)()

/logs/tmp/taserv/pandasrc/lib/python2.7/site-packages/pandas-0.12.0rc1-py2.7-linux-x86_64.egg/pandas/tslib.so in pandas.tslib._check_dts_bounds (pandas/tslib.c:13800)()

ValueError: Out of bounds nanosecond timestamp: 9999-12-31 00:00:00
In [9]: df.apply(lambda x: (x[0], datetime.datetime(2100,12,31),datetime.datetime(2100,12,31)), axis=1)
Out[9]:
    0                   1                   2
0  a0 2100-12-31 00:00:00 2100-12-31 00:00:00
1  a1 2100-12-31 00:00:00 2100-12-31 00:00:00
2  a2 2100-12-31 00:00:00 2100-12-31 00:00:00
3  a3 2100-12-31 00:00:00 2100-12-31 00:00:00
4  a4 2100-12-31 00:00:00 2100-12-31 00:00:00
5  a5 2100-12-31 00:00:00 2100-12-31 00:00:00
6  a6 2100-12-31 00:00:00 2100-12-31 00:00:00
7  a7 2100-12-31 00:00:00 2100-12-31 00:00:00
8  a8 2100-12-31 00:00:00 2100-12-31 00:00:00
9  a9 2100-12-31 00:00:00 2100-12-31 00:00:00
In [11]: data1 = [("a{0}".format(i), datetime.datetime(9999,12,31), datetime.datetime(9999,12,31)) for i in xrange(10)]

In [12]: df1 = pd.DataFrame(data1)

In [13]: df1
Out[13]:
    0                    1                    2
0  a0  9999-12-31 00:00:00  9999-12-31 00:00:00
1  a1  9999-12-31 00:00:00  9999-12-31 00:00:00
2  a2  9999-12-31 00:00:00  9999-12-31 00:00:00
3  a3  9999-12-31 00:00:00  9999-12-31 00:00:00
4  a4  9999-12-31 00:00:00  9999-12-31 00:00:00
5  a5  9999-12-31 00:00:00  9999-12-31 00:00:00
6  a6  9999-12-31 00:00:00  9999-12-31 00:00:00
7  a7  9999-12-31 00:00:00  9999-12-31 00:00:00
8  a8  9999-12-31 00:00:00  9999-12-31 00:00:00
9  a9  9999-12-31 00:00:00  9999-12-31 00:00:00

In [15]: np.version.version
Out[15]: '1.6.1'

In [16]: pd.version.version
Out[16]: '0.12.0rc1'
