@@ -855,13 +855,9 @@ def _str_extract_frame(arr, pat, flags=0):
855
855
856
856
857
857
def str_extract (arr , pat , flags = 0 , expand = True ):
858
- < << << << HEAD
859
858
"""
860
- =======
861
- r"""
862
859
Extract capture groups in the regex `pat` as columns in a DataFrame.
863
860
864
- > >> >> >> 21e8522102 c334acb79dd4a7b3f7a914af535a8e
865
861
For each subject string in the Series, extract groups from the
866
862
first match of regular expression `pat`.
867
863
@@ -1431,11 +1427,7 @@ def str_split(arr, pat=None, n=None):
1431
1427
1432
1428
1433
1429
def str_rsplit (arr , pat = None , n = None ):
1434
- <<<<<<< HEAD
1435
-
1436
- =======
1437
1430
1438
- >>>>>>> 21e8522102c334acb79dd4a7b3f7a914af535a8e
1439
1431
if n is None or n == 0 :
1440
1432
n = - 1
1441
1433
f = lambda x : x .rsplit (pat , n )
@@ -2350,11 +2342,9 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):
2350
2342
Split strings around given separator/delimiter.
2351
2343
2352
2344
Splits the string in the Series/Index from the %(side)s,
2353
- << << << < HEAD
2354
2345
at the specified delimiter string.Equivalent to :meth:`str.%(method)s`.
2355
- == == == =
2356
2346
at the specified delimiter string. Equivalent to :meth:`str.%(method)s`.
2357
- >> >> >> > 21e8522102 c334acb79dd4a7b3f7a914af535a8e
2347
+
2358
2348
2359
2349
Parameters
2360
2350
----------
@@ -2375,8 +2365,7 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):
2375
2365
Series, Index, DataFrame or MultiIndex
2376
2366
Type matches caller unless ``expand=True`` (see Notes).
2377
2367
2378
- << << << < HEAD
2379
- == == == =
2368
+
2380
2369
See Also
2381
2370
--------
2382
2371
Series.str.split : Split strings around given separator/delimiter.
@@ -2387,7 +2376,7 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):
2387
2376
str.split : Standard library version for split.
2388
2377
str.rsplit : Standard library version for rsplit.
2389
2378
2390
- >> >> >> > 21e8522102 c334acb79dd4a7b3f7a914af535a8e
2379
+
2391
2380
Notes
2392
2381
-----
2393
2382
The handling of the `n` keyword depends on the number of found splits:
@@ -2400,7 +2389,7 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):
2400
2389
If using ``expand=True``, Series and Index callers return DataFrame and
2401
2390
MultiIndex objects, respectively.
2402
2391
2403
- << << << < HEAD
2392
+
2404
2393
See Also
2405
2394
--------
2406
2395
%(also)s
@@ -2468,14 +2457,14 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):
2468
2457
0 1 2 3
2469
2458
0 this is good text
2470
2459
1 but this is even better
2471
- 2 NaN NaN NaN NaN
2460
+ 2 NaN NaN NaN NaN
2472
2461
2473
2462
>>> s.str.rsplit(n=3, expand=True)
2474
2463
0 1 2 3
2475
2464
0 this is good text
2476
2465
1 but this is even better
2477
2466
2 NaN NaN NaN NaN
2478
- == == == =
2467
+
2479
2468
Examples
2480
2469
--------
2481
2470
>>> s = pd.Series(["this is a regular sentence",
@@ -2544,31 +2533,23 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):
2544
2533
0 this is a regular sentence None
2545
2534
1 https://docs.python.org/3/tutorial index.html
2546
2535
2 NaN NaN
2547
- >> >> >> > 21e8522102 c334acb79dd4a7b3f7a914af535a8e
2536
+
2548
2537
""" )
2549
2538
2550
2539
@Appender (_shared_docs ['str_split' ] % {
2551
2540
'side' : 'beginning' ,
2552
- << << << < HEAD
2553
2541
'method' : 'split' ,
2554
- 'also ': 'rsplit : Splits string at the last occurrence of delimiter '
2555
- })
2556
- == == == =
2542
+ 'also' : 'rsplit : Splits string at the last occurrence of delimiter' ,
2557
2543
'method' : 'split' })
2558
- >> >> >> > 21e8522102 c334acb79dd4a7b3f7a914af535a8e
2559
2544
def split (self , pat = None , n = - 1 , expand = False ):
2560
2545
result = str_split (self ._parent , pat , n = n )
2561
2546
return self ._wrap_result (result , expand = expand )
2562
2547
2563
2548
@Appender (_shared_docs ['str_split' ] % {
2564
2549
'side' : 'end' ,
2565
- << << << < HEAD
2566
2550
'method' : 'rsplit' ,
2567
- 'also ': 'split : Splits string at the first occurrence of delimiter '
2568
- })
2569
- == == == =
2551
+ 'also' : 'split : Splits string at the first occurrence of delimiter' ,
2570
2552
'method' : 'rsplit' })
2571
- >> >> >> > 21e8522102 c334acb79dd4a7b3f7a914af535a8e
2572
2553
def rsplit (self , pat = None , n = - 1 , expand = False ):
2573
2554
result = str_rsplit (self ._parent , pat , n = n )
2574
2555
return self ._wrap_result (result , expand = expand )
0 commit comments