Repository: pandas-dev/pandas

Issue:
sparc: test_round_trip_frame... and test_unsorted_index
See at http://nipy.bic.berkeley.edu/builders/pandas-py2.x-sid-sparc/builds/18/steps/shell_4/logs/stdio

and that assert better has some descriptive failure message (or to be replaced with assertEqual/eq_)?

```
======================================================================
FAIL: test_round_trip_frame (pandas.io.tests.test_clipboard.TestClipboard)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_56_g0d80c79-py2.7-linux-sparc64.egg/pandas/io/tests/test_clipboard.py", line 50, in test_round_trip_frame
    self.check_round_trip_frame(dt)
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_56_g0d80c79-py2.7-linux-sparc64.egg/pandas/io/tests/test_clipboard.py", line 46, in check_round_trip_frame
    tm.assert_frame_equal(data, result)
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_56_g0d80c79-py2.7-linux-sparc64.egg/pandas/util/testing.py", line 236, in assert_frame_equal
    check_less_precise=check_less_precise)
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_56_g0d80c79-py2.7-linux-sparc64.egg/pandas/util/testing.py", line 197, in assert_series_equal
    assert(left.dtype == right.dtype)
AssertionError

======================================================================
FAIL: test_unsorted_index (pandas.tests.test_graphics.TestDataFramePlots)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_56_g0d80c79-py2.7-linux-sparc64.egg/pandas/tests/test_graphics.py", line 445, in test_unsorted_index
    tm.assert_series_equal(rs, df.y)
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_56_g0d80c79-py2.7-linux-sparc64.egg/pandas/util/testing.py", line 197, in assert_series_equal
    assert(left.dtype == right.dtype)
AssertionError

----------------------------------------------------------------------
Ran 3695 tests in 3708.536s
```

As you might know you can see results of builds/tests on sparc at
http://nipy.bic.berkeley.edu/waterfall?category=pandas . ATM it is polling GIT only once in 5h atm.



Discussion:
yes printing out the dtypes here is essential...i have no idea why the clipboard test wouldn't work

Yeah, there are a number of places where the `assert_*_equal` methods could be improved.

@cpcloud I think you fixed these?

not sure...i'll see if they are still fialing on th waterfall

these still failing?

These -- not seems to me, the failing ones are
http://nipy.bic.berkeley.edu/builders/pandas-py2.x-sid-sparc/builds/138/steps/shell_4/logs/stdio

```
======================================================================
ERROR: test_setitem (pandas.tests.test_series.TestSeries)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_564_gedbd512-py2.7-linux-sparc64.egg/pandas/tests/test_series.py", line 971, in test_setitem
    series[::2] = 0
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_564_gedbd512-py2.7-linux-sparc64.egg/pandas/core/series.py", line 1069, in __setitem__
    self._set_with(key, value)
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_564_gedbd512-py2.7-linux-sparc64.egg/pandas/core/series.py", line 1087, in _set_with
    return self._set_values(indexer, value)
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_564_gedbd512-py2.7-linux-sparc64.egg/pandas/core/series.py", line 1128, in _set_values
    self._data = self._data.setitem(key,value)
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_564_gedbd512-py2.7-linux-sparc64.egg/pandas/core/internals.py", line 2046, in setitem
    return self.apply('setitem', *args, **kwargs)
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_564_gedbd512-py2.7-linux-sparc64.egg/pandas/core/internals.py", line 2028, in apply
    applied = getattr(blk, f)(*args, **kwargs)
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_564_gedbd512-py2.7-linux-sparc64.egg/pandas/core/internals.py", line 577, in setitem
    values[indexer] = value
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_564_gedbd512-py2.7-linux-sparc64.egg/pandas/core/base.py", line 148, in _disabled
    self.__class__)
TypeError: '<class 'pandas.core.index.Index'>' does not support mutable operations.

======================================================================
FAIL: test_append_with_timedelta (pandas.io.tests.test_pytables.TestHDFStore)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_564_gedbd512-py2.7-linux-sparc64.egg/pandas/io/tests/test_pytables.py", line 1862, in test_append_with_timedelta
    assert_frame_equal(result,df)
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_564_gedbd512-py2.7-linux-sparc64.egg/pandas/util/testing.py", line 313, in assert_frame_equal
    assert_index_equal(left.index, right.index)
  File "/home/buildslave/nd-bb-slave-sparc-sid/pandas-py2_x-sid-sparc/build/venv/local/lib/python2.7/site-packages/pandas-0.12.0_564_gedbd512-py2.7-linux-sparc64.egg/pandas/util/testing.py", line 192, in assert_index_equal
    right.dtype))
AssertionError: [index] left [int64 Int64Index([0, 1, 2, 6, 7, 8, 9], dtype=int64)], right [Int64Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=int64) int64]
```

btw -- I have uploaded fresh numexpr and pytables today to sid... I will update sid buildbot so you could see if anything new pops out

can you put a `ci/print_versions.py` up here?

damn -- still haven't added it to buildbot... uff -- should be the same as last time though I mentioned in some report:

```
$> ci/print_versions.py 

INSTALLED VERSIONS
------------------
Python: 2.7.5.final.0
OS: Linux 2.6.32-5-sparc64-smp #1 SMP Sun May 6 09:31:16 UTC 2012 sparc64
LC_ALL: None
LANG: None

Cython: 0.19.1
Numpy: 1.7.1
Scipy: 0.12.0
statsmodels: 0.4.2
    patsy: 0.2.1
scikits.timeseries: Not installed
dateutil: 1.5
pytz: 2012c
bottleneck: Not installed
PyTables: 2.4.0
    numexpr: 2.0.1
matplotlib: 1.3.0
openpyxl: 1.6.1
xlrd: 0.9.2
xlwt: 0.7.4
sqlalchemy: 0.8.2
lxml: 3.2.0
bs4: 4.2.1
html5lib: 0.95-dev
```

pytables will probably be built for sparc only by tomorrow so I will update env then

@yarikoptic as we discussed, you can also do `from pandas.util.print_version import show_verison; show_version()`


Resolving patch:
diff --git a/pandas/core/series.py b/pandas/core/series.py
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -135,6 +135,12 @@ def __init__(self, data=None, index=None, dtype=None, name=None,
 
             if isinstance(data, MultiIndex):
                 raise NotImplementedError
+            elif isinstance(data, Index):
+                # need to copy to avoid aliasing issues
+                if name is None:
+                    name = data.name
+                data = data.values
+                copy = True
             elif isinstance(data, pa.Array):
                 pass
             elif isinstance(data, Series):


Test patch:
diff --git a/pandas/tests/test_index.py b/pandas/tests/test_index.py
--- a/pandas/tests/test_index.py
+++ b/pandas/tests/test_index.py
@@ -2221,9 +2221,10 @@ def test_tolist(self):
         self.assertEqual(result, exp)
 
     def test_repr_with_unicode_data(self):
-        d = {"a": [u("\u05d0"), 2, 3], "b": [4, 5, 6], "c": [7, 8, 9]}
-        index = pd.DataFrame(d).set_index(["a", "b"]).index
-        self.assertFalse("\\u" in repr(index))  # we don't want unicode-escaped
+        with pd.core.config.option_context("display.encoding",'UTF-8'):
+            d = {"a": [u("\u05d0"), 2, 3], "b": [4, 5, 6], "c": [7, 8, 9]}
+            index = pd.DataFrame(d).set_index(["a", "b"]).index
+            self.assertFalse("\\u" in repr(index))  # we don't want unicode-escaped
 
     def test_unicode_string_with_unicode(self):
         d = {"a": [u("\u05d0"), 2, 3], "b": [4, 5, 6], "c": [7, 8, 9]}