Skip to content

Fix #1982 #1983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from Oct 1, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _has_complex_internals(self):

def summary(self, name=None):
if len(self) > 0:
index_summary = ', %s to %s' % (str(self[0]), str(self[-1]))
index_summary = ', %s to %s' % (unicode(self[0]), unicode(self[-1]))
else:
index_summary = ''

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def test_repr_corner(self):

def test_frame_info_encoding(self):
index = ['\'Til There Was You (1997)',
'\xc1 k\xf6ldum klaka (Cold Fever) (1994)']
'ldum klaka (Cold Fever) (1994)']
fmt.set_printoptions(max_rows=1)
df = DataFrame(columns=['a', 'b', 'c'], index=index)
repr(df)
Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
class TestIndex(unittest.TestCase):

def setUp(self):
self.unicodeIndex = tm.makeUnicodeIndex(100)
self.strIndex = tm.makeStringIndex(100)
self.dateIndex = tm.makeDateIndex(100)
self.intIndex = tm.makeIntIndex(100)
Expand Down Expand Up @@ -374,6 +375,7 @@ def test_take(self):
def _check_method_works(self, method):
method(self.empty)
method(self.dateIndex)
method(self.unicodeIndex)
method(self.strIndex)
method(self.intIndex)
method(self.tuples)
Expand Down
7 changes: 7 additions & 0 deletions pandas/util/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def rands(n):
choices = string.ascii_letters + string.digits
return ''.join([random.choice(choices) for _ in xrange(n)])

def randu(n):
choices = u"".join(map(unichr,range(1488,1488+26))) + string.digits
return ''.join([random.choice(choices) for _ in xrange(n)])

#-------------------------------------------------------------------------------
# Console debugging tools

Expand Down Expand Up @@ -183,6 +187,9 @@ def getCols(k):
def makeStringIndex(k):
return Index([rands(10) for _ in xrange(k)])

def makeUnicodeIndex(k):
return Index([randu(10) for _ in xrange(k)])

def makeIntIndex(k):
return Index(range(k))

Expand Down