equal
deleted
inserted
replaced
1 Creating a linear array:\\ |
1 Slicing \& Striding a list:\\ |
2 {\ex \lstinline| x = linspace(0, 2*pi, 50)|} |
2 {\ex \lstinline| A[start:stop:step]|} \lstinline|stop| excluded |
3 |
3 |
4 Plotting two variables:\\ |
4 Sorting a list:\\ |
5 {\ex \lstinline| plot(x, sin(x))|} |
5 {\ex \lstinline| sorted(A)|} -- returns new list |
|
6 {\ex \lstinline| A.sort()|} -- in-place sort |
6 |
7 |
7 Plotting two lists of equal length x, y:\\ |
8 Reversing a list:\\ |
8 {\ex \lstinline| plot(x, y)|} |
9 {\ex \lstinline| A[::-1]|} -- returns new list |
|
10 {\ex \lstinline| A.reverse()|} -- in-place reverse |