What You Will Learn You will create lists, arrays and matrices using scipy You will learn to slice, reverse, append and plot arrays Lists in Python Type in the code at the Ipython console from scipy import * x=[1,2,3,4,5] The first line imports all modules in scipy. The second line creates a list in the variable x. Type x at the console and observe the list Type x[0:2] at the console and observe the first two values in the list Type x[3:5] at the console and observe a slice of the list Type x[::-1] at the console and observe the reversed list Type len(x) at the console and observe the length of the list x Type y=[4,5,6] and then type x+y observe the two lists getting concatenated. Type append(x,y) observe a similar result Type z=['apple','orange','pear'] to create a list of strings Arrays using Scipy scipy and numpy provide arrays that support mathematical operations. Type x=array([1,2,3,4,5]) at the cons...
Comments
Post a Comment