File tree 3 files changed +13
-1
lines changed
3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ Bug Fixes
52
52
**I/O **
53
53
54
54
- Bug in reading a HDF5 table-format ``DataFrame `` created in Python 2, in Python 3 (:issue: `24925 `)
55
- -
55
+ - Bug where float indexes could have misaligned values when printing ( :issue: ` 25061 `)
56
56
-
57
57
58
58
**Categorical **
Original file line number Diff line number Diff line change @@ -1060,6 +1060,11 @@ def get_result_as_array(self):
1060
1060
def format_values_with (float_format ):
1061
1061
formatter = self ._value_formatter (float_format , threshold )
1062
1062
1063
+ # default formatter leaves a space to the left when formatting
1064
+ # floats, must be consistent for left-justifying NaNs (GH #25061)
1065
+ if self .justify == 'left' :
1066
+ self .na_rep = ' ' + self .na_rep
1067
+
1063
1068
# separate the wheat from the chaff
1064
1069
values = self .values
1065
1070
mask = isna (values )
Original file line number Diff line number Diff line change @@ -198,6 +198,13 @@ def test_latex_repr(self):
198
198
199
199
assert s ._repr_latex_ () is None
200
200
201
+ def test_categorical_index_repr_in_frame_with_nan (self ):
202
+ i = Index ([1 , np .nan ])
203
+ s = Series ([1 , 2 ], index = i )
204
+ exp = """1.0 1\n NaN 2\n dtype: int64"""
205
+
206
+ assert repr (s ) == exp
207
+
201
208
202
209
class TestCategoricalRepr (object ):
203
210
You can’t perform that action at this time.
0 commit comments