Skip to content

Commit 4ede22a

Browse files
sreejatasreejata
sreejata
authored and
sreejata
committed
Cleaning up
1 parent 38f96dd commit 4ede22a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/strings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ def str_split(arr, pat=None, n=None, return_type='series'):
651651

652652
if return_type not in ('series', 'index', 'frame', 'same', 'expand'):
653653
raise ValueError("return_type must be {'series', 'index', 'frame', 'same', 'expand'}")
654-
if return_type in ['frame', 'expand'] and isinstance(arr, Index):
654+
if return_type in ('frame', 'expand') and isinstance(arr, Index):
655655
raise ValueError("return_type='frame' is not supported for string "
656656
"methods on Index")
657657
if pat is None:
@@ -668,7 +668,7 @@ def str_split(arr, pat=None, n=None, return_type='series'):
668668
n = 0
669669
regex = re.compile(pat)
670670
f = lambda x: regex.split(x, maxsplit=n)
671-
if return_type == 'frame' or return_type == 'expand':
671+
if return_type in ('frame', 'expand'):
672672
res = DataFrame((Series(x) for x in _na_map(f, arr)), index=arr.index)
673673
else:
674674
res = _na_map(f, arr)

0 commit comments

Comments
 (0)