BUG: GH3461 Fix sorting in a frame with a list of columns which contains datetime64
State: closed

closes #3461


Labels:

Comments:
Hello, I just built pandas from source, and received this error on running unit tests:

``` ======================================================================
FAIL: test_sort_datetimes (pandas.tests.test_frame.TestDataFrame)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/_/__/lib/python2.7/site-packages/pandas-0.11.1.dev_3406a54-py2.7-macosx-10.6-intel.egg/pandas/tests/test_frame.py", line 8473, in test_sort_datetimes
    assert_frame_equal(df1,df2)
  File "/Users/_/__/lib/python2.7/site-packages/pandas-0.11.1.dev_3406a54-py2.7-macosx-10.6-intel.egg/pandas/util/testing.py", line 230, in assert_frame_equal
    assert(left.index.equals(right.index))
AssertionError

----------------------------------------------------------------------
Ran 3428 tests in 106.337s

FAILED (SKIP=129, failures=1)
```

I was wondering if I might have an outdated dependency. As I intend to use DataFrames, I'm a little disturbed by this failed unit test.

I get this error every time I run my own test suite. I've been ignoring it
because it passes in Travis and I never handle datetimes. That said, I ran
a test script over recent commits: the error occurs in every commit
starting from the one that merged this issue (pandas@2842383). I'm using
OSX 10.8 and get this error - maybe it's a mac thing?

On Thu, Jun 20, 2013 at 10:31 AM, Doug von Kohorn
notifications@github.comwrote:

> Hello, I just built pandas from source, and received this error on running
> unit tests:
> 
> ## FAIL: test_sort_datetimes (pandas.tests.test_frame.TestDataFrame)
> 
> Traceback (most recent call last):
>   File "/Users/_/__/lib/python2.7/site-packages/pandas-0.11.1.dev_3406a54-py2.7-macosx-10.6-intel.egg/pandas/tests/test_frame.py", line 8473, in test_sort_datetimes
>     assert_frame_equal(df1,df2)
>   File "/Users/_/__/lib/python2.7/site-packages/pandas-0.11.1.dev_3406a54-py2.7-macosx-10.6-intel.egg/pandas/util/testing.py", line 230, in assert_frame_equal
>     assert(left.index.equals(right.index))
> AssertionError
> 
> ---
> 
> Ran 3428 tests in 106.337s
> 
> FAILED (SKIP=129, failures=1)
> 
> I was wondering if I might have an outdated dependency. As I intend to use
> DataFrames, I'm a little disturbed by this failed unit test.
> 
> —
> Reply to this email directly or view it on GitHubhttps://github.com/pydata/pandas/pull/3464#issuecomment-19756711
> .

interestingly see #3902 seems
that some int64 values on macos are different
than everyone else in tr world

I'll bet that thr value for NaT is corrupted

I'd be happy to place around with this, but I can't find where in the numpy
docs/source NaT is defined, etc. Any tips on where to look?

On Thu, Jun 20, 2013 at 11:00 AM, jreback notifications@github.com wrote:

> interestingly see #3902 https://github.com/pydata/pandas/issues/3902seems
> that some int64 values on macos are different
> than everyone else in tr world
> 
> I'll bet that thr value for NaT is corrupted
> 
> —
> Reply to this email directly or view it on GitHubhttps://github.com/pydata/pandas/pull/3464#issuecomment-19758856
> .

let's make a new issue about this....

`pandas/src/numpy_helper.h.....get_nat`

this is copied from #3902

and ONLY true on mac (AFAIK)

the wraparound is troubling.....

```
In [1]: pd.Timestamp(np.iinfo(np.int64).max)
Out[1]: Timestamp('2262-04-11 23:47:16.854775807', tz=None)

In [2]: pd.Timestamp(np.iinfo(np.int64).min)
Out[2]: NaT

In [3]: pd.Timestamp(np.iinfo(np.int64).min + 1)
Out[3]: Timestamp('2262-04-10 00:12:43.145224193', tz=None)

```