Skip to content

Commit 2cbb1fd

Browse files
simplify code
1 parent 56aa391 commit 2cbb1fd

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
@@ -1965,19 +1965,15 @@ def items_overlap_with_suffix(left, lsuffix, right, rsuffix):
19651965

19661966
def lrenamer(x):
19671967
if x in to_rename:
1968-
if lsuffix is None and isinstance(x, str):
1969-
return '{x}{lsuffix}'.format(x=x, lsuffix='')
1970-
elif lsuffix is None and isinstance(x, (float, int)):
1968+
if lsuffix is None:
19711969
return x
19721970
else:
19731971
return '{x}{lsuffix}'.format(x=x, lsuffix=lsuffix)
19741972
return x
19751973

19761974
def rrenamer(x):
19771975
if x in to_rename:
1978-
if rsuffix is None and isinstance(x, str):
1979-
return '{x}{rsuffix}'.format(x=x, rsuffix='')
1980-
elif rsuffix is None and isinstance(x, (float, int)):
1976+
if rsuffix is None:
19811977
return x
19821978
else:
19831979
return '{x}{rsuffix}'.format(x=x, rsuffix=rsuffix)

0 commit comments

Comments
 (0)