‫Now let's move on to
‫Next library which is seaborn.
‫Seaborn is a library for data visualization
‫Most commonly used library is matplotlib
‫But for our course we think seaborn is much more suited that's why you will be discussing seaborn only
‫You want you can learn about ####### on your own.
‫First we will import the
‫seaborn library we will write input seaborn as SNS.
‫Now
‫To plot the distribution of our age variable
‫from our customer table will write SNS
‫.thisplot
‫Bracket I will mention my
‫Column name it is customer
‫data 2
‫Dot
‫age capital A.
‫You can see this histogram of our age variable
‫Is first
‫Creating bins of all the ages
‫So the minimum value in our age variable is 18 and the maximum is 17
‫Python has created different Bin
‫Between these two values
‫And then
‫Plotted the number of variables in those bins in the form of bar this is called histogram.
‫You can see most of our customer are in this last bucket
‫This line is also known as KDE kernel density estimate
‫And we are not going into explanation on how to arrive on this line so
‫We are just going to remove this line.
‫To remove this line
‫we'll Write SNS dot plot data to.age
‫And then KDE equal to false.
‫Now the KDE line is removed.
‫If you want to see
‫Arguments of any function you can just write help
‫And in bracket you can write that function.
‫Example in our case we'll write SNS dot plot.
‫It will show you the syntax of that function
‫All the variables that it is taking
‫And the default values of those variable
‫so by default KDE was true that's why we were getting the KDE plot
‫And you can change the value to false to to remove the KDE.
‫Similarly there are other variables as well
‫You can create a rug plot if you write#######equal to true
‫If you can have a look at this and read the documentation
‫Now you will change the colour of this graph.
‫You can see colour is also a variable
‫We will
‫Just write sns.thisplot
‫Colour equal to red
‫Red in double quotes run this can see the colour is now
‫Changed to red.
‫Seaborn library comes with various data sets
‫No we will just import one of such database also known as Iris
‫So will right Iris Iris is our
‫Name of variable containing Iris dataset
‫Then we'll write Sns.plot
‫Underscore data set
‫And in bracket will write Iris.
‫Run this
‫You can view a sample of this data set by using Iris
‫.#######
‫So our data contains
‫5 columns
‫sepal length,sepal width
‫petal length,petal width
‫and specie this is the data of flowers where we have sepal length and sepal width and petal
‫Length and Petal width.
‫And then the specie of that flower.
‫To get the number of columns we'll write Iris dot shape
‫and run this
‫You can see there are total 150 rows
‫There are five columns
‫You want to get the mean value median value minimum value and maximum value we can also write Iris.
‫Describe
‫This will you show us some statistics of all this
‫Four columns.
‫Now
‫Will plot a scatter plot
‫Between sepal Length and sepal width.
‫To do that will write ######
‫#######
‫our x variable
‫Should be sepal length I'l write sepal length
‫And y variable is sepal width
‫And then our data is Iris.
‫If you run this
‫You are getting
‫Scatter plot
‫Between sepal length and sepal width
‫on the top we have distribution of sepal length
‫And
‫The right hand side we have distribution of sepal width.
‫There are other variations of this scatter plot also if you want to change the colour of
‫dots the size of this dot if you want a Shady plot with this histogram Shady plot or
‫####### You can find all this with the help option of joint
‫And we will discuss that during our uni variate analysis.
‫Next
‫Another important function is pair plot
‫So while doing our analysis instead of plotting
‫Scatter plot for all the variables we can
‫Do it for all the variables using just one command
‫That is sns.pairplot
‫And in bracket we just have to mention the data frame that is Iris.
‫It will create scatter plot for all the
‫Variable.
‫For example this is a distribution of
‫Sepal length
‫This is a scatter plot of sepal Length and sepal width
‫This is a scatter plot of sepal length and Petal length
‫This is a scatter plot of sepal length
‫and petal width.
‫This is a very useful command and in a single command we can get scatter plot for all our variables.
‫That's all for this video and that's all for Python crash course
‫This is just a crash course
‫You are not covering anything in deep
‫And as we go along will discuss all this things in more detail.