zeros( shapex dtypeor by copying the arraya copy(or by using the convenient function zeros_likea np zeros_like(xzeros and same size as if we write function that takes either list or an array as an argumentbut inside the function it needs to be an arraywe can ensure that it is converted by using the function asarraya asarray(athis statement will convert to an array if needed ( if is list or single number)but do nothing if is already an array the list slicing that we briefly introduced in also works for arraysand we can extract elements from an array using [ : :iherethe slice : : implies set of indices (fromtoincrement)exactly as for lists we can also use any list or array of integers to index into another arraya linspace( array( ] [[ , , ] array( ] [range( , , )- same as [ : : - array( - - ]finallywe can use an array of boolean expressions to pick out elements of an arrayas demonstrated in the following examplea [falsefalsetruefalsefalsetruefalsefalsea[ pick out all negative elements array([- - ] [ max(if [ ]< set [ ]= array( ]these indexing methods can often be quite usefulsincefor efficiencywe often want to avoid for loops over arrays elements many operations that are naturally implemented as for loops can be replaced by creative array slicing and indexingwith potentially substantial improvements in efficiency arrays can have any dimension just as listsarrays can have more than one index two-dimensional arrays are particularly relevantsince these are natural representations offor instancea table of numbers for instanceto represent set of numbers such as