54
54
"zfill" ,
55
55
56
56
# _vec_string - Will gradually become ufuncs as well
57
- "mod" , "decode" , "encode" , "upper" , "lower" , "swapcase" , "capitalize" ,
58
- "title" , "join" , "split" , "rsplit" , "splitlines" , "partition" ,
59
- "rpartition" , "translate" ,
57
+ "upper" , "lower" , "swapcase" , "capitalize" , "title" ,
58
+
59
+ # _vec_string - Will probably not become ufuncs
60
+ "mod" , "decode" , "encode" , "translate" ,
61
+
62
+ # Removed from namespace until behavior has been crystalized
63
+ # "join", "split", "rsplit", "splitlines", "partition", "rpartition",
60
64
]
61
65
62
66
@@ -1145,7 +1149,7 @@ def replace(a, old, new, count=-1):
1145
1149
return _replace (arr , old , new , counts , out = out )
1146
1150
1147
1151
1148
- def join (sep , seq ):
1152
+ def _join (sep , seq ):
1149
1153
"""
1150
1154
Return a string which is the concatenation of the strings in the
1151
1155
sequence `seq`.
@@ -1168,18 +1172,18 @@ def join(sep, seq):
1168
1172
1169
1173
Examples
1170
1174
--------
1171
- >>> np.strings.join('-', 'osd')
1172
- array('o-s-d', dtype='<U5')
1175
+ >>> np.strings.join('-', 'osd') # doctest: +SKIP
1176
+ array('o-s-d', dtype='<U5') # doctest: +SKIP
1173
1177
1174
- >>> np.strings.join(['-', '.'], ['ghc', 'osd'])
1175
- array(['g-h-c', 'o.s.d'], dtype='<U5')
1178
+ >>> np.strings.join(['-', '.'], ['ghc', 'osd']) # doctest: +SKIP
1179
+ array(['g-h-c', 'o.s.d'], dtype='<U5') # doctest: +SKIP
1176
1180
1177
1181
"""
1178
1182
return _to_bytes_or_str_array (
1179
1183
_vec_string (sep , np .object_ , 'join' , (seq ,)), seq )
1180
1184
1181
1185
1182
- def split (a , sep = None , maxsplit = None ):
1186
+ def _split (a , sep = None , maxsplit = None ):
1183
1187
"""
1184
1188
For each element in `a`, return a list of the words in the
1185
1189
string, using `sep` as the delimiter string.
@@ -1205,11 +1209,11 @@ def split(a, sep=None, maxsplit=None):
1205
1209
Examples
1206
1210
--------
1207
1211
>>> x = np.array("Numpy is nice!")
1208
- >>> np.strings.split(x, " ")
1209
- array(list(['Numpy', 'is', 'nice!']), dtype=object)
1212
+ >>> np.strings.split(x, " ") # doctest: +SKIP
1213
+ array(list(['Numpy', 'is', 'nice!']), dtype=object) # doctest: +SKIP
1210
1214
1211
- >>> np.strings.split(x, " ", 1)
1212
- array(list(['Numpy', 'is nice!']), dtype=object)
1215
+ >>> np.strings.split(x, " ", 1) # doctest: +SKIP
1216
+ array(list(['Numpy', 'is nice!']), dtype=object) # doctest: +SKIP
1213
1217
1214
1218
See Also
1215
1219
--------
@@ -1222,7 +1226,7 @@ def split(a, sep=None, maxsplit=None):
1222
1226
a , np .object_ , 'split' , [sep ] + _clean_args (maxsplit ))
1223
1227
1224
1228
1225
- def rsplit (a , sep = None , maxsplit = None ):
1229
+ def _rsplit (a , sep = None , maxsplit = None ):
1226
1230
"""
1227
1231
For each element in `a`, return a list of the words in the
1228
1232
string, using `sep` as the delimiter string.
@@ -1255,8 +1259,9 @@ def rsplit(a, sep=None, maxsplit=None):
1255
1259
Examples
1256
1260
--------
1257
1261
>>> a = np.array(['aAaAaA', 'abBABba'])
1258
- >>> np.strings.rsplit(a, 'A')
1259
- array([list(['a', 'a', 'a', '']), list(['abB', 'Bba'])], dtype=object)
1262
+ >>> np.strings.rsplit(a, 'A') # doctest: +SKIP
1263
+ array([list(['a', 'a', 'a', '']), # doctest: +SKIP
1264
+ list(['abB', 'Bba'])], dtype=object) # doctest: +SKIP
1260
1265
1261
1266
"""
1262
1267
# This will return an array of lists of different sizes, so we
@@ -1265,7 +1270,7 @@ def rsplit(a, sep=None, maxsplit=None):
1265
1270
a , np .object_ , 'rsplit' , [sep ] + _clean_args (maxsplit ))
1266
1271
1267
1272
1268
- def splitlines (a , keepends = None ):
1273
+ def _splitlines (a , keepends = None ):
1269
1274
"""
1270
1275
For each element in `a`, return a list of the lines in the
1271
1276
element, breaking at line boundaries.
@@ -1294,7 +1299,7 @@ def splitlines(a, keepends=None):
1294
1299
a , np .object_ , 'splitlines' , _clean_args (keepends ))
1295
1300
1296
1301
1297
- def partition (a , sep ):
1302
+ def _partition (a , sep ):
1298
1303
"""
1299
1304
Partition each element in `a` around `sep`.
1300
1305
@@ -1323,8 +1328,8 @@ def partition(a, sep):
1323
1328
Examples
1324
1329
--------
1325
1330
>>> x = np.array(["Numpy is nice!"])
1326
- >>> np.strings.partition(x, " ")
1327
- array([['Numpy', ' ', 'is nice!']], dtype='<U8')
1331
+ >>> np.strings.partition(x, " ") # doctest: +SKIP
1332
+ array([['Numpy', ' ', 'is nice!']], dtype='<U8') # doctest: +SKIP
1328
1333
1329
1334
See Also
1330
1335
--------
@@ -1335,7 +1340,7 @@ def partition(a, sep):
1335
1340
_vec_string (a , np .object_ , 'partition' , (sep ,)), a )
1336
1341
1337
1342
1338
- def rpartition (a , sep ):
1343
+ def _rpartition (a , sep ):
1339
1344
"""
1340
1345
Partition (split) each element around the right-most separator.
1341
1346
@@ -1368,10 +1373,10 @@ def rpartition(a, sep):
1368
1373
Examples
1369
1374
--------
1370
1375
>>> a = np.array(['aAaAaA', ' aA ', 'abBABba'])
1371
- >>> np.strings.rpartition(a, 'A')
1372
- array([['aAaAa', 'A', ''],
1373
- [' a', 'A', ' '],
1374
- ['abB', 'A', 'Bba']], dtype='<U5')
1376
+ >>> np.strings.rpartition(a, 'A') # doctest: +SKIP
1377
+ array([['aAaAa', 'A', ''], # doctest: +SKIP
1378
+ [' a', 'A', ' '], # doctest: +SKIP
1379
+ ['abB', 'A', 'Bba']], dtype='<U5') # doctest: +SKIP
1375
1380
1376
1381
"""
1377
1382
return _to_bytes_or_str_array (
0 commit comments