Skip to content

Commit

Permalink
Merge branch 'pandas-dev:main' into series-sum-attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
fbourgey authored Feb 3, 2025
2 parents 311b662 + f1441b2 commit 95cb745
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion doc/source/user_guide/gotchas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -372,5 +372,5 @@ constructors using something similar to the following:
s = pd.Series(newx)
See `the NumPy documentation on byte order
<https://numpy.org/doc/stable/user/basics.byteswapping.html>`__ for more
<https://numpy.org/doc/stable/user/byteswapping.html>`__ for more
details.
25 changes: 11 additions & 14 deletions pandas/tests/io/formats/test_to_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,17 @@ def test_to_string_with_formatters_unicode(self):
)
assert result == expected

def test_to_string_index_formatter(self):
df = DataFrame([range(5), range(5, 10), range(10, 15)])

rs = df.to_string(formatters={"__index__": lambda x: "abc"[x]})

xp = dedent(
"""\
0 1 2 3 4
a 0 1 2 3 4
b 5 6 7 8 9
c 10 11 12 13 14\
"""
)
assert rs == xp
def test_to_string_index_formatter(self):
df = DataFrame([range(5), range(5, 10), range(10, 15)])
rs = df.to_string(formatters={"__index__": lambda x: "abc"[x]})
xp = dedent(
"""\
0 1 2 3 4
a 0 1 2 3 4
b 5 6 7 8 9
c 10 11 12 13 14"""
)
assert rs == xp

def test_no_extra_space(self):
# GH#52690: Check that no extra space is given
Expand Down

0 comments on commit 95cb745

Please sign in to comment.