Skip to content

Commit 1001ecf

Browse files
simplify code
1 parent 56065ce commit 1001ecf

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pandas/core/internals/managers.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,19 +1973,15 @@ def items_overlap_with_suffix(left, lsuffix, right, rsuffix):
19731973

19741974
def lrenamer(x):
19751975
if x in to_rename:
1976-
if lsuffix is None and isinstance(x, str):
1977-
return '{x}{lsuffix}'.format(x=x, lsuffix='')
1978-
elif lsuffix is None and isinstance(x, (float, int)):
1976+
if lsuffix is None:
19791977
return x
19801978
else:
19811979
return '{x}{lsuffix}'.format(x=x, lsuffix=lsuffix)
19821980
return x
19831981

19841982
def rrenamer(x):
19851983
if x in to_rename:
1986-
if rsuffix is None and isinstance(x, str):
1987-
return '{x}{rsuffix}'.format(x=x, rsuffix='')
1988-
elif rsuffix is None and isinstance(x, (float, int)):
1984+
if rsuffix is None:
19891985
return x
19901986
else:
19911987
return '{x}{rsuffix}'.format(x=x, rsuffix=rsuffix)

0 commit comments

Comments
 (0)