participation.py - import the module import numpy as np create a one dimensional array called q1 with values 2.5 5 7.5 97.5 100 q1=np.arange(2.5,101,2.5

# participation.py - import the module import numpy as np...

This preview shows page 1 - 2 out of 2 pages.

# import the module import numpy as np # create a one dimensional array called q1 with values 2.5, 5, 7.5, ... , 97.5, 100 q1=np.arange(2.5,101,2.5) # create an array called q2 with only the values in q1 that are divisble by 4 q2=q1[q1%4==0] #print(q2) # create a 2 dimensional (15 x 15) array called q3 with values from 1-225: # [[ 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15], # [16,17,18,19,20,21,22,23,24,25,26,27,28,29,30], # .... # [211,212,213,...,223,224,225]] q3=np.arange(1,226) q3=q3.reshape(15,15) #print(q3) # create an 2 dimensional (15 x 2) array called q4 # where each row of q4 is made up of the first 2 values in each row of q3 # [[ 1, 2], # [16,17], # [31,31] # ... # [196,197], # [211,212]] q4=q3[:,0:2] q4=q4.reshape(15,2) #print(q4) # create an array called q5 of shape (12,8) filled entirely with 0 (all floats)  #### You've reached the end of your free preview.

• • •  