File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -42,18 +42,18 @@ Methods like ``split`` return a Series of lists:
42
42
s2 = Series([' a_b_c' , ' c_d_e' , np.nan, ' f_g_h' ])
43
43
s2.str.split(' _' )
44
44
45
- Easy to expand this to return a DataFrame
45
+ Elements in the split lists can be accessed using `` get `` or `` [] `` notation:
46
46
47
47
.. ipython :: python
48
48
49
- s2.str.split(' _' ).apply(Series)
49
+ s2.str.split(' _' ).str.get(1 )
50
+ s2.str.split(' _' ).str[1 ]
50
51
51
- Elements in the split lists can be accessed using ``get `` or `` [] `` notation:
52
+ Easy to expand this to return a DataFrame using ``return_type ``.
52
53
53
54
.. ipython :: python
54
55
55
- s2.str.split(' _' ).str.get(1 )
56
- s2.str.split(' _' ).str[1 ]
56
+ s2.str.split(' _' , return_type = ' frame' )
57
57
58
58
Methods like ``replace `` and ``findall `` take `regular expressions
59
59
<https://docs.python.org/2/library/re.html> `__, too:
You can’t perform that action at this time.
0 commit comments