Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (55.6k points)

Can anyone tell me the use of the numpy library in Python?

1 Answer

0 votes
by (119k points)

Numpy is an open-source and fundamental library to handle multi-dimensional arrays. Numpy has a lot of in-built functions to handle arrays and here are the few examples:

Import numpy as np

array_1 = np.array ([2,3,4], [7,8,9]) #To create an array from the lists

array_2 = np.array((5, 9, 8, 2))  #To create an array from the tuple

array_3 = np.zeros ((2, 3)) #To create an 2 by 3 matrix with zeros

array_4 = np.full ((4,4), 5) #To create a 4 by 4 matrix with all 5s

Numpy also has functions like resize(), append(), insert(), unique(), etc. functions. Numpy has official documentation with detailed explanations with examples.

You can check out this Python Tutorial by Intellipaat to learn using Numpy library:

Related questions

0 votes
1 answer
asked May 15, 2020 in Python by Sudhir_1997 (55.6k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...