File tree 1 file changed +39
-10
lines changed
1 file changed +39
-10
lines changed Original file line number Diff line number Diff line change @@ -433,17 +433,46 @@ Bug fixes
433
433
a ``Series `` with either a single character at each index of the original
434
434
``Series `` or ``NaN ``. For example,
435
435
436
- .. ipython :: python
437
- :okexcept:
438
-
439
- strs = " go" , " bow" , " joe" , " slow"
440
- ds = pd.Series(strs)
441
-
442
- for s in ds.str:
443
- print (s)
436
+ .. code-block :: ipython
444
437
445
- s
446
- s.dropna().values.item() == " w"
438
+ In [38]: strs = "go", "bow", "joe", "slow"
439
+
440
+ In [32]: ds = pd.Series(strs)
441
+
442
+ In [33]: for s in ds.str:
443
+ ...: print(s)
444
+
445
+ 0 g
446
+ 1 b
447
+ 2 j
448
+ 3 s
449
+ dtype: object
450
+ 0 o
451
+ 1 o
452
+ 2 o
453
+ 3 l
454
+ dtype: object
455
+ 0 NaN
456
+ 1 w
457
+ 2 e
458
+ 3 o
459
+ dtype: object
460
+ 0 NaN
461
+ 1 NaN
462
+ 2 NaN
463
+ 3 w
464
+ dtype: object
465
+
466
+ In [41]: s
467
+ Out[41]:
468
+ 0 NaN
469
+ 1 NaN
470
+ 2 NaN
471
+ 3 w
472
+ dtype: object
473
+
474
+ In [42]: s.dropna().values.item() == "w"
475
+ Out[42]: True
447
476
448
477
The last element yielded by the iterator will be a ``Series `` containing
449
478
the last element of the longest string in the ``Series `` with all other
You can’t perform that action at this time.
0 commit comments