Skip to content

Commit

Permalink
limited output using .head()
Browse files Browse the repository at this point in the history
limited output of string processing examples
using .head()
  • Loading branch information
natethedrummer committed May 25, 2017
1 parent ff53ca9 commit 2cee47f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doc/source/comparison_with_sas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ trailing blanks.

.. ipython:: python
tips['time'].str.len()
tips['time'].str.rstrip().str.len()
tips['time'].str.len().head()
tips['time'].str.rstrip().str.len().head()
Find
Expand All @@ -398,7 +398,7 @@ you supply as the second argument.
data _null_;
set tips;
put(FINDW(sex,'ALE'));
put(FINDW(sex,'ale'));
run;
Python determines the position of a character in a string with the
Expand All @@ -409,7 +409,7 @@ the function will return -1 if it fails to find the substring.

.. ipython:: python
tips['sex'].str.find("ALE")
tips['sex'].str.find("ale").head()
Substring
Expand All @@ -431,7 +431,7 @@ indexes are zero-based.

.. ipython:: python
tips['sex'].str[0:1]
tips['sex'].str[0:1].head()
Scan
Expand All @@ -451,7 +451,7 @@ second argument specifies which word you want to extract.
John Smith;
Jane Cook;
;;;
run;
run;
Python extracts a substring from a string based on its text
by using regular expressions. There are much more powerful
Expand Down

0 comments on commit 2cee47f

Please sign in to comment.