diff options
author | Puneeth Chaganti | 2010-11-09 16:14:58 +0530 |
---|---|---|
committer | Puneeth Chaganti | 2010-11-09 16:14:58 +0530 |
commit | fb1b64961cd3334451b36acd8b2ca20f90cc8043 (patch) | |
tree | 36edaaed08fef0593a072c6d740834267d7f57e0 | |
parent | 57d448ea7637e249c9a229154360d7c553ead002 (diff) | |
download | st-scripts-fb1b64961cd3334451b36acd8b2ca20f90cc8043.tar.gz st-scripts-fb1b64961cd3334451b36acd8b2ca20f90cc8043.tar.bz2 st-scripts-fb1b64961cd3334451b36acd8b2ca20f90cc8043.zip |
Changes to manipulating lists quickref.
-rw-r--r-- | manipulating-lists/quickref.tex | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/manipulating-lists/quickref.tex b/manipulating-lists/quickref.tex index b26d168..d571a9e 100644 --- a/manipulating-lists/quickref.tex +++ b/manipulating-lists/quickref.tex @@ -1,8 +1,10 @@ -Creating a linear array:\\ -{\ex \lstinline| x = linspace(0, 2*pi, 50)|} +Slicing \& Striding a list:\\ +{\ex \lstinline| A[start:stop:step]|} \lstinline|stop| excluded -Plotting two variables:\\ -{\ex \lstinline| plot(x, sin(x))|} +Sorting a list:\\ +{\ex \lstinline| sorted(A)|} -- returns new list +{\ex \lstinline| A.sort()|} -- in-place sort -Plotting two lists of equal length x, y:\\ -{\ex \lstinline| plot(x, y)|} +Reversing a list:\\ +{\ex \lstinline| A[::-1]|} -- returns new list +{\ex \lstinline| A.reverse()|} -- in-place reverse |