DIFFERENT ARRAY OPERATIONS USING NUMPY

leoumesh(72)
Published in
OCD
Words
34
Reading
1 min
Listen
Play
6y

This is a basic program in which you can perform various operations on array with the numpy package.

from numpy import *
arr=array([23,55,34,10,4.0])
print(arr)
print(arr.dtype)

arr=array([23,55,34,10,4.0],int)
print(arr)
print(arr.dtype)

arr=linspace(0,15,20)
print(arr)

arr=arange(0,16,2)
print(arr)

arr=zeros(6)
print(arr)

arr=ones(5,int)
print(arr)

You can see the output for this program by copying/pasting into this online python compiler application: https://www.onlinegdb.com/online_python_compiler

DIFFERENT ARRAY OPERATIONS USING NUMPY | Ecency