Skip to content

Commit 7a0cf0c

Browse files
committed
Fix tests
1 parent bbed286 commit 7a0cf0c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pandas/core/strings.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ def str_slice(arr, start=None, stop=None, step=None):
11781178
return _na_map(f, arr)
11791179

11801180

1181-
def str_slice_replace(arr, start=None, stop=None, repl=''):
1181+
def str_slice_replace(arr, start=None, stop=None, repl=None):
11821182
"""
11831183
Replace a positional slice of a string with another value.
11841184
@@ -1192,8 +1192,9 @@ def str_slice_replace(arr, start=None, stop=None, repl=''):
11921192
Right index position to use for the slice. The default of None
11931193
implies a slice unbounded on the right, i.e. slice until the
11941194
end of the string.
1195-
repl : str, default ''
1196-
String for replacement.
1195+
repl : str, optional
1196+
String for replacement. The default of None replaces the slice
1197+
with an empty string.
11971198
11981199
Returns
11991200
-------
@@ -1249,6 +1250,9 @@ def str_slice_replace(arr, start=None, stop=None, repl=''):
12491250
4 aXde
12501251
dtype: object
12511252
"""
1253+
if repl is None:
1254+
repl = ''
1255+
12521256
def f(x):
12531257
if x[start:stop] == '':
12541258
local_stop = start

0 commit comments

Comments
 (0)