Skip to main content

Numpy Library


 Hello Guys,

In this blog we will learn about the most important library of python which is NUMPY. 

What is numpy?

Numpy is a python library that provides a multidimensional array object. It provide fast operations on array. With the help of this library we can do mathematical, logical and basic statistical operation on array. 

To use numpy library we have to install it in our machine so that we can use this library. To install this library just insert the following command into your command prompt or terminal. 

>>> pip install numpy

Now you can easily access the numpy library.

How to create 1D Array






In the above image, first we import the numpy library. Then with the help of array method we can create the numpy array. 
On line no. 2 we create the one dimensional array. In this array you can store integers, float etc. In the array method we must have to pass list to create a array. 

How to create 2D Array



                          In the above figure we create a 2D or 2 dimensional array. To create 2D array we have to pass one list in the array method and in that list we have to pass again two or more lists. So that we can create a 2D array. 

So like this we can create n dimensional array in python with the help of Numpy library. 

We will learn more about the numpy array like more methods of the numpy array in the next blog. 

Please SUBSCRIBE to our YouTube channel. 

Comments

Contact Form

Name

Email *

Message *

Popular posts from this blog

Rock Paper and Scissor Game Using Tkinter | Python |

 Rock Paper and Scissor Game Using Tkinter Hello Friends in this blog we will learn how to create Rock Paper & Scissor game using tkinter. Tkinter provides GUI toolkit. Tkinter is a built in library of python with the help of this we can create so many GUI applications. To create Rock Paper & Scissor game their are some conditions: Rock + Paper => Paper Win Rock+Scissor =>Rock Win Rock+Rock => Match Draw Paper+Rock => Paper win Paper+Scissor=> scissor win Paper+Paper => Draw Scissor+Paper => Scissor Win Scissor+Rock => Rock Win Scissor+Scissor =>Match Draw Our complete project is depend on this conditions. Steps to complete this project: 1. Import require modules and library 2. Create Basic GUI window for our projects: 3. Declare the values for computer & score of player and computer: 4. Create a function for Rock: 5. Create Function for Paper: 6. Create a function for Scissor: 7. Create a function to reset our game: This is code snippets of this