 Now, these are the basic operations that we can do and there are many more we are not going to go into all you can explore, but you just see that how to do define variables and how to create least arrays and how to do addition, subtractions like basic operations not only on the numbers but also on the strings and then you saw that how to write conditions like e-files and how to do looping like for loop and a while. Now, we are often we have to deal with the data and that data may be coming in some files which we need to read and do operations on that. If you reading the files, Python has this very handy library called pandas and when we want so if you want to use it, again we need to first load it and also like it is not necessary that all the Python if you have just installed the basic version of the Python it has already this pandas inbuilt it, but maybe want to get that library in your installation and by the way I think if you install pandas and all sorry Anaconda and all maybe that will already have this packages readily installed. So, let us first get this pandas library imported as pd and now I have a file called pokeman underscore data so that I have stored here it is in the same directory where I am running this Jupyter notebook and here we have so many options available to play with our data. First thing is we need to read all the data and get into a data frame or like get it into some array so Python provides a very handy way of getting this data in terms of a data frames first I can read all the content of my CSV file and put it into a variable which I am denoting as df here to read this all I need to do is simply write pd dot read dot CSV read dot CSV is the function I need to call to read all the content of my file. Now suppose I want to see ok maybe let us clear all my cells here you know all the things are fine I have to only get started here now I have imported my pandas library and now when I read this all the data is now come into this variable df here and now in the df suppose now I can do various options one of the operations I want to see that I want to see what all the headers right ok maybe let us open this file here this is a file let me see I can open this ok let me not open like this let me first download and open it ok let me see if I can open it in Excel ok now you see that whenever I have such a data set the first row will be usually what type of column it has and then first row is what type column and usually the first column will be basically index indexing each of the rows and after that for each row you will have attributes for all of this columns ok. So when we have such a data loaded first we want to see that what are the headers in this what are data is stored in this file so we want to read this first row and here you see that so this is a Pokemon data set I do not know much I have not seen this Pokemon I think it looks like a famous cartoon there are famous very lots of pokemons and they come in different types maybe type 1 and type 2 and under type 1 also they have different values like grass fire water and all and under type 2 it is like a poison flying dragon and all and they have some other characters like what is their HP attack defense I do not know what is SP attack maybe special attack or special defense whatever all this information is stored here and now when I want to when I use this function dot head and give phi what is going to show me to show me the fall the fighter and you show me the first top five rows and the first five top row such this is this is like gives me a first immediate glimpse of what this data is containing like what kind of attributes it is like maybe I can read these are like attributes type 1 type 2 HP attack defense these are like attributes of the data and now in the defense in this DF variable I can now see that what are its columns ok now it shows it is simply going to see when you did this dot head it kind of nicely showed me in a little formatted way what are the columns and showed me information about this columns by displaying the first few rows but when you do this DF column it will simply showing me the first row ok so it will giving me some information about what the first row is about and now I can do a lot of operations all the data is saved in my variable DF now suppose I am only interested in the two columns which has this name and type 1 as their attributes and I want to see the first five rows of these two columns so I have to just use this function so this is the specifying how many rows I want to see and this one is shows in specifying which columns I would be interested in ok so here it is just showing me this column name column and type 1 column and only showing the first five rows and similarly if I want to see the first four rows and column ok so here 0 to 4 rows are shown so notice that here only integer locations are shown here and in our data he had the first row did not corresponded to an integer right it was like something hash here so the integer is starting from 1 here I think that is where it started and it is and it showed the next four rows ok and it showed me the first column here sorry here index is 1 that means it showed me the values from the second column similarly if I am interested in only particular value let us say I am interested in the index 2 on the row and index 1 on the column I can just specify that using my I lock function I lock here stands for I think integer location and that is in my data is simply when you saw ok. Now I may be interested in knowing for I am now let us say I am interested in only on one column here type 1 column and I want to see that in this column where the value this attribute type is taking value 5 so then I need to get this first when I do this df type 1 that means it is focusing on my column with the type 1 as the attribute and it is looking in that all where the value is matching to be 5 and it will show me only those. Now if you look into it is only displaying me those rows where type 1 is all 5 and this is happening in the rows 4, 5th, 6th, 7th, 8th, 42, 43 like that ok. Now you can do sorting or maybe get some summary of your data and there is a very convenient function called describe. So, here this describe function gives me kind of all these basic statistics like count, mean, standard deviation, minimum value, first quartile, second quartile, third quartile and the max value of each of my attributes here which are numerical. So, notice that type 1 and type 2 features are not numerical wherever that the features that corresponds to the numerical values for this all these basic statistics is shown. And now you can also get the values in ascending and descending value by using this sort value function let us see what I get by executing this. So, here I am using the name attribute and I want it to be put in a ascending order. So, here 0 means it is going to going to put in a descending order 0 means descending order if you want it to be an ascending it is 1. So, here the variable is ascending, but its value is 0 or 1 based on that it is going to put it in ascending or descending. You see that even though the name has the the string value it has put them in a descending value starting the first one here has a z and as you go down you will see that things are ordered starting from z and all the way to a in additionary way. And you can also make changes to your data like we did it in our list. So, for suppose we have this many heads here like attributes here suppose I want to add another one let us say I want to add another one total which is basically the sum of all the values that are happening in this HP column attack column and defense column and all I can do this and if I do this now and when I see this now head now we will see that that total also. So, we have basically earlier this total column was not there, but I added this column and I got this information. Similarly, you can drop columns like this column I am dropping the new column I added total I am simply dropping by using this drop column and whatever the modification you do to your data now you can store it as a new file suppose like you have data this df now you have initially loaded it from a file now you have done a lot of modification or some modification on that now you want to save it as another CSV file. So, you can say this modified CSV and give index as true then it will show it as a new file. If I do this so that is what this modified file is what it gets just created just created just now it got created just now. So, there are many multiple things you can do like you can filter out your data. For example, in the type 1 you want to only look where the value is grass and only look for that's where the type 2 is poison and you can list them. So, if you look now type 1 is all grass and type 2 is all poison you can do various perpetuation in combination of this. You want to list only those columns where the type 1 is grass or type 2 is poison you can just use this LOC function and get them. See here if you see that I type 1 I type 2 at least one of them is grass or poison. So, you can do all the combinations here and yeah you can even check these conditions and get like here if what I have done is I have looked for type 1 to be grass and type 2 to be poison and when the HP value is greater than 70. So, you will see that in all the things I have there are all the HP values are greater than 70. I can also do some conditional changes like if I have if I want to let us say type 1 wherever it is value is fire I want to replace it by let us say flamer. I can do that by using this LOC function again. So, you will see that wherever that fire was there now it is got replaced by flamer and you can do the similar things here. So, there are other things like you can get some aggregate statistics I think you can just play around you just look into this function group by and you will get this. So, we will stop here and I think with this we have all the basics of how to create variables manipulate them not only the locally, but also read it from the another files and play around this. So, in the next session we will see that how we can use some of the statistical tools on data and see how some of the things we have learned in this course can be used. This will stop here.