Numpy is a python library to create homogeneous multidimensional arrays and provide tools for working with these arrays.

The elements of numpy array are of the same type. One can create an array in Python using lists or array() function. The advantage of using Numpy array is it scales better and takes less memory when compared to standard Python list or array.

Using Numpy, you can perform following operations:

Mathematical and logical operations on arrays.

Fourier transforms and routines for shape manipulation.

Operations related to linear algebra. NumPy has inbuilt functions for linear algebra and random number generation.

Basic Definitions

NumPy Arrays: A numpy array is a grid of values, all of the same type, and is indexed by a tuple of nonnegative integers.

Rank: The number of dimensions is the rank of the array.

Shape: the shape of an array is a tuple of integers giving the size of the array along each dimension.

Question: Give Rank for the following NumPy arrays:

1) [1, 2, 1]

2) [[ 1., 2., 3.],
[ 3., 0., 2.]]

The first array has rank 1 because the array is one dimensional. Second numpy array has rank 2 because it is a two-dimensional array.

Installation – NumPy

There are many ways to install Numpy library. Here is the link to official documentation to do so.

The simplest way to install Numpy is to write this in your command line.pip install numpy

Ndarray and Ndarray Attributes

NumPy’s array class is called ndarray. It is also known by the alias array. Note that numpy.array is not the same as the Standard Python Library class array.array, which only handles one-dimensional arrays and offers less functionality. Here is some most important attribute of the ndarray object:

ndarray.ndim: the number of dimensions of the array. In Numpy, the number of dimensions is also the rank of the array.

ndarray.shape: A tuple of integers representing the size of an array. For a matrix with n rows and m columns, the shape will be (n,m).

ndarray.size: the total number of elements of the array. It is also equal to the product of the elements of shape.

ndarray.dtype: It is an object that describes the type of the elements in the array.

ndarray.data: It is a buffer that contains the actual elements of the array.

I simply want to tell you that I am just new to blogs and definitely enjoyed your blog. Most likely I’m going to bookmark your website . You really have beneficial articles and reviews. Thank you for sharing with us your web-site.

I simply want to tell you that I am newbie to blogging and definitely liked you’re web blog. Most likely I’m planning to bookmark your blog . You certainly have exceptional article content. Thanks a lot for sharing with us your web site.

“Thanks for sharing superb informations. Your web-site is so cool. I’m impressed by the details that youвЂ™ve on this website. It reveals how nicely you perceive this subject. Bookmarked this web page, will come back for more articles. You, my friend, ROCK! I found just the info I already searched all over the place and simply could not come across. What an ideal web-site.”

Superb blog! Do you have any suggestions for aspiring
writers? I’m hoping to start my own blog soon but I’m a little lost on everything.
Would you propose starting with a free platform like WordPress or go for a paid option? There are so many
options out there that I’m totally confused .. Any recommendations?

Hi, I believe your site could possibly be having browser compatibility issues.
When I look at your blog in Safari, it looks fine
however when opening in IE, it’s got some overlapping issues.
I merely wanted to provide you with a quick heads
up! Other than that, wonderful blog!

I do agree with all of the ideas you’ve offered
for your post. They’re very convincing and can definitely work.
Nonetheless, the posts are too brief for newbies.
May just you please extend them a bit from subsequent time?
Thank you for the post.

I am really impressed with your writing skills as well as with the layout on your weblog.
Is this a paid theme or did you customize it yourself?
Either way keep up the nice quality writing, it is rare to
see a nice blog like this one nowadays.

I like the valuable information you provide to your articles.
I will bookmark your blog and take a look at once more here regularly.
I am relatively certain I will learn plenty of new stuff right here!
Best of luck for the next!

Thank you a lot for giving everyone remarkably splendid opportunity to read critical reviews from this web site. It really is very excellent plus stuffed with fun for me personally and my office acquaintances to search the blog at the very least thrice in a week to learn the new items you have. And definitely, I am just certainly fascinated for the terrific things you give. Selected 2 ideas in this posting are undeniably the most efficient we have all ever had.

Youre so cool! I dont suppose Ive learn something like this before. So good to find any person with some authentic ideas on this subject. realy thank you for starting this up. this web site is one thing that is needed on the net, somebody with slightly originality. helpful job for bringing something new to the internet!

I simply want to tell you that I am just new to blogs and definitely enjoyed your blog. Most likely I’m going to bookmark your website . You really have beneficial articles and reviews. Thank you for sharing with us your web-site.

Woah! I’m really digging the template/theme of this site.
It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between usability and visual appeal.
I must say you have done a great job with this. In addition, the blog loads extremely fast
for me on Firefox. Superb Blog!