NumPy Array in Python

Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python

Program 1

# Array using numpy
# array()
# linespace()
# arange()
# zeros()
# ones() 

import numpy  as np
#myar=np.array([1,2],int)
# myar=np.array([1.6,2.7,6.4,7.7,8.4,6.8],float)
# print(myar)
# myar=np.linspace(1,100,10)
# print(myar)
# n=int(input("Enter the limit"))
# myar=np.arange(1,n+1,1)
# print(myar)
myar=np.zeros(10)
print(myar)
myar=np.ones(10)
print(myar)

 

You give me 15 seconds I promise you best tutorials
Please share your happy experience on Google

courses
Image

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *