@@ -207,7 +207,7 @@ def normalize(series):
207
207
line = ax .scatter (to_plot [class_ ][0 ],
208
208
to_plot [class_ ][1 ],
209
209
color = random_color (class_ ),
210
- label = com ._stringify (class_ ), ** kwds )
210
+ label = com .pprint_thing (class_ ), ** kwds )
211
211
ax .legend ()
212
212
213
213
ax .add_patch (patches .Circle ((0.0 , 0.0 ), radius = 1.0 , facecolor = 'none' ))
@@ -272,8 +272,8 @@ def random_color(column):
272
272
f = function (row )
273
273
y = [f (t ) for t in x ]
274
274
label = None
275
- if com ._stringify (class_col [i ]) not in used_legends :
276
- label = com ._stringify (class_col [i ])
275
+ if com .pprint_thing (class_col [i ]) not in used_legends :
276
+ label = com .pprint_thing (class_col [i ])
277
277
used_legends .add (label )
278
278
ax .plot (x , y , color = random_color (class_col [i ]), label = label )
279
279
ax .legend (loc = 'upper right' )
@@ -378,8 +378,8 @@ def random_color(column):
378
378
y = row
379
379
label = None
380
380
kls = class_col .iget_value (i )
381
- if com ._stringify (kls ) not in used_legends :
382
- label = com ._stringify (kls )
381
+ if com .pprint_thing (kls ) not in used_legends :
382
+ label = com .pprint_thing (kls )
383
383
used_legends .add (label )
384
384
ax .plot (x , y , color = random_color (kls ), label = label , ** kwds )
385
385
@@ -671,7 +671,7 @@ def _adorn_subplots(self):
671
671
self .axes [0 ].set_title (self .title )
672
672
673
673
if self ._need_to_set_index :
674
- labels = [_stringify (key ) for key in self .data .index ]
674
+ labels = [com . pprint_thing (key ) for key in self .data .index ]
675
675
labels = dict (zip (range (len (self .data .index )), labels ))
676
676
677
677
for ax_ in self .axes :
@@ -685,10 +685,10 @@ def legend_title(self):
685
685
if not isinstance (self .data .columns , MultiIndex ):
686
686
name = self .data .columns .name
687
687
if name is not None :
688
- name = com ._stringify (name )
688
+ name = com .pprint_thing (name )
689
689
return name
690
690
else :
691
- stringified = map (com ._stringify ,
691
+ stringified = map (com .pprint_thing ,
692
692
self .data .columns .names )
693
693
return ',' .join (stringified )
694
694
else :
@@ -742,13 +742,13 @@ def _get_index_name(self):
742
742
if isinstance (self .data .index , MultiIndex ):
743
743
name = self .data .index .names
744
744
if any (x is not None for x in name ):
745
- name = ',' .join ([com ._stringify (x ) for x in name ])
745
+ name = ',' .join ([com .pprint_thing (x ) for x in name ])
746
746
else :
747
747
name = None
748
748
else :
749
749
name = self .data .index .name
750
750
if name is not None :
751
- name = com ._stringify (name )
751
+ name = com .pprint_thing (name )
752
752
753
753
return name
754
754
@@ -806,7 +806,7 @@ def _make_plot(self):
806
806
ax = self ._get_ax (i )
807
807
style = self ._get_style (i , label )
808
808
809
- label = com ._stringify (label )
809
+ label = com .pprint_thing (label )
810
810
811
811
gkde = gaussian_kde (y )
812
812
sample_range = max (y ) - min (y )
@@ -902,7 +902,7 @@ def _maybe_add_color(kwargs, style, i):
902
902
903
903
_maybe_add_color (kwds , style , i )
904
904
905
- label = _stringify (label )
905
+ label = com . pprint_thing (label ). encode ( 'utf-8' )
906
906
907
907
mask = com .isnull (y )
908
908
if mask .any ():
@@ -947,7 +947,7 @@ def to_leg_label(label, i):
947
947
if isinstance (data , Series ):
948
948
ax = self ._get_ax (0 ) #self.axes[0]
949
949
style = self .style or ''
950
- label = com ._stringify (self .label )
950
+ label = com .pprint_thing (self .label )
951
951
kwds = kwargs .copy ()
952
952
_maybe_add_color (kwds , style , 0 )
953
953
@@ -959,7 +959,7 @@ def to_leg_label(label, i):
959
959
labels .append (leg_label )
960
960
else :
961
961
for i , col in enumerate (data .columns ):
962
- label = com ._stringify (col )
962
+ label = com .pprint_thing (col )
963
963
ax = self ._get_ax (i )
964
964
style = self ._get_style (i , col )
965
965
kwds = kwargs .copy ()
@@ -1097,7 +1097,7 @@ def _make_plot(self):
1097
1097
K = self .nseries
1098
1098
1099
1099
for i , (label , y ) in enumerate (self ._iter_data ()):
1100
- label = com ._stringify (label )
1100
+ label = com .pprint_thing (label )
1101
1101
kwds = self .kwds .copy ()
1102
1102
kwds ['color' ] = colors [i % len (colors )]
1103
1103
@@ -1125,7 +1125,7 @@ def _make_plot(self):
1125
1125
1126
1126
def _post_plot_logic (self ):
1127
1127
for ax in self .axes :
1128
- str_index = [_stringify (key ) for key in self .data .index ]
1128
+ str_index = [com . pprint_thing (key ) for key in self .data .index ]
1129
1129
1130
1130
name = self ._get_index_name ()
1131
1131
if self .kind == 'bar' :
@@ -1359,7 +1359,7 @@ def boxplot(data, column=None, by=None, ax=None, fontsize=None,
1359
1359
1360
1360
def plot_group (grouped , ax ):
1361
1361
keys , values = zip (* grouped )
1362
- keys = [_stringify (x ) for x in keys ]
1362
+ keys = [com . pprint_thing (x ) for x in keys ]
1363
1363
values = [remove_na (v ) for v in values ]
1364
1364
ax .boxplot (values , ** kwds )
1365
1365
if kwds .get ('vert' , 1 ):
@@ -1394,7 +1394,7 @@ def plot_group(grouped, ax):
1394
1394
cols = columns
1395
1395
else :
1396
1396
cols = data .columns
1397
- keys = [_stringify (x ) for x in cols ]
1397
+ keys = [com . pprint_thing (x ) for x in cols ]
1398
1398
1399
1399
# Return boxplot dict in single plot case
1400
1400
@@ -1411,14 +1411,6 @@ def plot_group(grouped, ax):
1411
1411
fig .subplots_adjust (bottom = 0.15 , top = 0.9 , left = 0.1 , right = 0.9 , wspace = 0.2 )
1412
1412
return ret
1413
1413
1414
-
1415
- def _stringify (x ):
1416
- if isinstance (x , tuple ):
1417
- return '|' .join (com ._stringify (y ) for y in x )
1418
- else :
1419
- return com ._stringify (x )
1420
-
1421
-
1422
1414
def format_date_labels (ax , rot ):
1423
1415
# mini version of autofmt_xdate
1424
1416
try :
@@ -1455,8 +1447,8 @@ def plot_group(group, ax):
1455
1447
else :
1456
1448
fig = ax .get_figure ()
1457
1449
plot_group (data , ax )
1458
- ax .set_ylabel (com ._stringify (y ))
1459
- ax .set_xlabel (com ._stringify (x ))
1450
+ ax .set_ylabel (com .pprint_thing (y ))
1451
+ ax .set_xlabel (com .pprint_thing (x ))
1460
1452
1461
1453
ax .grid (grid )
1462
1454
@@ -1620,7 +1612,7 @@ def boxplot_frame_groupby(grouped, subplots=True, column=None, fontsize=None,
1620
1612
for (key , group ), ax in zip (grouped , axes ):
1621
1613
d = group .boxplot (ax = ax , column = column , fontsize = fontsize ,
1622
1614
rot = rot , grid = grid , figsize = figsize , ** kwds )
1623
- ax .set_title (_stringify (key ))
1615
+ ax .set_title (com . pprint_thing (key ))
1624
1616
ret [key ] = d
1625
1617
else :
1626
1618
from pandas .tools .merge import concat
@@ -1676,7 +1668,7 @@ def _grouped_plot(plotf, data, column=None, by=None, numeric_only=True,
1676
1668
if numeric_only and isinstance (group , DataFrame ):
1677
1669
group = group ._get_numeric_data ()
1678
1670
plotf (group , ax )
1679
- ax .set_title (com ._stringify (key ))
1671
+ ax .set_title (com .pprint_thing (key ))
1680
1672
1681
1673
return fig , axes
1682
1674
@@ -1710,7 +1702,7 @@ def _grouped_plot_by_column(plotf, data, columns=None, by=None,
1710
1702
gp_col = grouped [col ]
1711
1703
plotf (gp_col , ax )
1712
1704
ax .set_title (col )
1713
- ax .set_xlabel (com ._stringify (by ))
1705
+ ax .set_xlabel (com .pprint_thing (by ))
1714
1706
ax .grid (grid )
1715
1707
1716
1708
byline = by [0 ] if len (by ) == 1 else by
0 commit comments