#28 Python Tutorial for Beginners | Why Numpy? Installing Numpy in Pycharm

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] welcome back aliens my name is Ivan ready and let's continue this series on Python now until this point we have worked on arrays and we are happy you know because we know how to work with a day we know how to insert values we know how to fetch a value but is a thing we talk about arrays we have different types of at is available example the first one is single dimensional array and second one is multi-dimensional array now when you is a single dimensional it means you have a one draw right so you have one role and multiple columns example the array which we are working with so it has one role and multiple columns right you can see we have multiple columns there but what if you want to work with multi dimensional atom it simply means you will be having multiple rows and multiple columns when I say multi-dimensional it can be 2d which is two dimensional it can be three dimensional it can you four dimensional right so it can have multiple dimension 0 now the way you can represent that is something in this way so when you say single dimensional it is how it looks like when you say multi dimensional you can imagine this is 2 di which is 2 dimensional array or you can imagine 3d which is you can imagine as a cube format right now when you say 2 dimensional array you can use it for using let's say matrix so let's say if you have if you are working on some scientific calculation you have metrics there you can use 2d array right so it is so useful right working with multi dimensional array so can you do it in Python of course we can write so it's one of the best language but here's the thing if we talk about the atom which is available in Python for you in that you cannot work with mighty dimensional array unfortunately because even if we try for that example if I create an array so let me just remove this disk OD from here because I'm using with I'm using a de here right and if I want to create an array which is multi dimensional I would say a our R is equal to array and the type of the array will say I and we want to assign multi dimensional right so the way you do that is by giving multiple square because if you say one square X 1 row if you want to have multiple rows you have to give 2 square bracket in each square bracket will have a value so we'll say 1 comma 2 comma 3 and then we got another array which is 2 comma 4 comma 5 comma 4 so we call two areas here so when you combine them it becomes multi-dimensional right and if I try to print this added here you can say this will not work so you can see we got an error here okay so how do we work with multi-dimensional because in a day we don't have that so the package which we are using here which is a D does not support multi-dimensional and that's where we can use a third-party package and that is your numpy some people say numpy doesn't matter so we have a package first numpy and we have to use that so we can simply say number shop if you're fetching from any package we will use a numpy package okay and in number also we can take any but we are getting error here you can see if I go back here it says unresolved the reference numpy spelling mistake no it's it's perfect what if I say by default numpy package is not available in python you have to install it you have to you have to run it manually okay but before doing this let me just go to IDL e so this is my ideally and here I want to use that package let's try so I would say import numpy and you can see we caught an error it says numpy is not a model which is installed so it says no model named numpy so we need to install it how will you install this so in Python we got this amazing tool called as VIP so you have to use p IP in fact we have two three here PRT basically stands for its articles see it's a recursive full form which is VIP installed packages okay so if you want to install any other packages in fact we have a lot of packages available and if you want to install them we have to use VIP so I will go to my command prompt and here I will say pip3 okay the version 3 and you need to install numpy so you have to say install numpy ok that's it simple command and say enter it will take some time ok so we wait for some time to install it ok you can see it is it says numpy successfully installed because see I'm doing this for the second time I already have I already had an umpire I removed it so that I can I can I can type the code here but then if you install number for the first time I guess it will also ask you for the agreement or confirmation you can simply say yes there and you can see in this system now we have numpy I will just restart my ideal and I will going to at the same things I would say import numpy and you can see there is no that means we have numpy in the system now but then it is fun it is for ideally right how about pycharm so if you want to work with PyCharm with thumb pipe you need to install damper here as well because you can see we still we are still getting error here so how do we install numpy in your PyCharm to do that we need to use a shortcut for Windows which is ctrl shift or ctrl alt s which is simply going to setting so we'll say file settings and here you need to make sure that you click on project test project or project and your particular project name click on project interpreter here you need to install numpy right so you want you what you will do is you click on this plus symbol and here you have to search for numpy so we got numpy here click on install it's so simple right you just say next next next everything is done so it is talking it will take some time it also depend up on your internet speed your system speed so it will take some time and you can see it is installed now click on close ok so you can see we got numpy here this one which is a legend is 1.15 so that's great we got the latest version so numpy is installed but it is not referring ok it's working you can see that you can see we call it from numba numba import star and i think it should work but there's one change here when you work with numpy first of all let's work with normal adding ok it's not that when you have numpy you cannot work with single dimensional array we can i will just remove this this two dimensional array here let's work with one dimension at it just to verify this working I will say shift f10 oh we got an error because in numpy we just need to change the way it works they don't have to actually mention the type field ok it is optional you can you can skip the type and you can see if you save 10 it works right so this is how you work with numpy again we'll use numpy to work with single dimensional multi-dimensional and we'll do some operations as well but as at this point now we know why we need numpy now we know how to install numpy and now we know how to get a simple array using numpy and yes you can still mention the type if you want to example if you want to mention this is ain't at the end just give a comma and say end ok so we do that as well i mean we can do that as well so let's run this code ok so it still works so that's how you use numpy so in the in the subsequent videos will work more on numpy so I hope you enjoyed this is a pin on the comment section click on like button if you're enjoying it thanks for watching everyone Baba you
Info
Channel: Telusko
Views: 489,109
Rating: undefined out of 5
Keywords: telusko, navin, reddy, tutorial, java, python
Id: 8LlXhtfNZEQ
Channel Id: undefined
Length: 6min 58sec (418 seconds)
Published: Fri Jul 20 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.