Data Visualization using Python Seaborn | Data Science | Seaborn | Visualisation | SuMyPyLab

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
data visualization using caborn caborn is a well-known python library for data visualization it is built on Matt plot lib it offers a userfriendly interface for generating appealing charts with less code almost all kinds of charts can be generated using this powerful Library so let's begin if the Seaborn module is not already installed in your system you may install this using the PIP command pip install caborn as shown on the screen C born installation is complete let's check the version for confirmation the version is 0.13.0 for working with any visualization package we need data sets that will be visualized it is implied that we have the required data set and we want to visualize it Seaborn comes with a bundle of data sets that we may use for learning visualization techniques in the following examples we will use few data sets available in caborn so let's find out what data sets are available in caborn we will use the get uncore data set uncore names function for this [Music] purpose let's run the code and check the output so these are the data sets that we may use for learning data visualization using [Music] caborn in our first example we will use the tips data set so let's load it using the load uncore data set function let's first view few top rows of the data [Music] set the various Columns of the data frame are total underscore Bill tip sex smoker day time and size we may also see the columns using DF do columns now let's check the shape of the data [Music] frame as we can see the data frame has 244 rows and seven columns and we already know the column names we have got our data frame let's plot a simple graph using this data set let's start with a very simple line plot we will also use the matplot lip. pyplot here so let's import this module also [Music] let's plot a graph using seaborn's line plot function the line plot function accepts a number of arguments here we are using only the data X and Y arguments let's view the graph using the PLT doow function and here is our graph this is very basic graph we can decorate this graph with various other parameters let's let's add a title to the [Music] graph now let's change the chart type to relative chart the ra plot function of Seaborn is used for this [Music] purpose what we see on the screen is a relative plot where the tip amount against the total underscore bill amount is plotted it is basically a scatter plot now we can change the chart type using the kind parameter the default type is [Music] [Music] scatter now let's change the chart type to [Music] line so using the ra plot function we can plot either a line chart or a scatter chart now let's explore a few other important parameters of the real plot function one by one let's divide the plot into two columns using the time values of dinner and lunch the left-and side column is for the lunchtime tips and the right hand side column is for the dinnertime [Music] tips now let's change the Hue based on the value of smoker or nonsmoker now the blue dots represent the smokers and the yellow dots represent the non-smokers let's change the marker Styles based on the values of smoker or non-smoker observe observe carefully that the marker styles are changed now the marker for the smokers is circular dots and the marker for the non-smokers are crosses we may also change the sizes of the dots or the crosses using the size parameter for the size parameter we are using the size column of the data frame look the size of the dots and Crosses have increased proportionately to the tip sizes now let's change the chart type to line using the kind parameter and see how the chart looks [Music] and the output is in accordance with the supplied arguments the rail plot function accepts a number of arguments and these are shown on the screen we may use these parameters as per our needs let's apply a theme to The Plot here we are setting the default theme using the set uncore theme [Music] function notice the gray background of the scatter plot this is the default [Music] theme we have already learned how to create scatter plot using the ra plot function now we will use the LM plot function to enhance the scatter plot by including a linear regression model in this example too we are using the tips data frame we are using the parameters data X Y call and hue [Music] Let's test the code and here is the output look the plot includes regression lines too in both columns the left hand side column is for the lunchtime tips and the right hand side is for the dinner time tips now we will use the dis plot function the dis plot function is used for plotting distributions such as a histogram here we are using only three parameters data X and call the histogram for the total bill column is shown on the screen the left hand side is for the lunchtime total bill and the right hand side is for the dinnertime total bill we may also include the KD parameter for displaying the kernel density estimation line see the kernel distribution estimation line is also drawn now we may change the type of the distribution using the kind parameter here the kind is set to ecdf empirical commutative distribution function few additional parameters are also included for better [Music] presentation oh no we should have removed the KD parameter from here this parameter is not applicable here [Music] we may also change the appearance of the rug using the rugor kws [Music] [Music] parameter [Music] [Music] now let's move to our next plot type cat plot that is plotting categorical [Music] [Music] data [Music] here the kind parameter is set to swarm that is here we will get a swam plot swarm plot plots every [Music] observations and here is the Swarm plot for various days now let's change the kind parameter to violin for creating a violin plot we may also add the split parameter for splitting the [Music] violin now we will set the kind parameter to bar for plotting a bar [Music] plot [Music] now let's plot a box plot using the box plot [Music] [Music] function [Music] our next plot is the count plot it plots the count the values against the X [Music] parameter in this graph the counts for the male and female customers are plotted now we will learn the uses of the strip plot function a strip plot is a single axis scatter plot that is used to visualize the distribution of many individual one-dimensional [Music] values here is our first strip plot for the total bill column the strip plot function accepts a number of arguments let's explore these one by [Music] one [Music] [Music] [Music] [Music] now we will learn the uses of the boxing plot box and plot is used to draw an enhanced box plot it is generally used for larger data sets this function takes a number of parameters let's explore a few of them one by [Music] [Music] one [Music] [Music] [Music] so far in this lesson we have learned a number of plot types using the Seaborn package caborn is a huge package it has many plotting functions with numerous parameters let me finish this lesson here we will learn more about this package in our next lessons heat map cluster map facet grid Paar grid pair plot joint grid joint plot regge plot Etc will be covered in our next lesson that's all for today's lesson if you find this lesson helpful please don't forget to like share comment and subscribe your valuable feedback is important for me and will help me improve the contents of the channel thanks for watching up to the end hope to see you in the next bye
Info
Channel: SuMyPyLab
Views: 9,467
Rating: undefined out of 5
Keywords: Python Seaborn, Data Visualization using Python Seaborn, Plotting using Python Seaborn, Seaborn, SuMyPyLab, Data Science, Data Analysis using Python, seaborn charts examples, how to plot using seaborn, visualization seaborn, beautiful seaborn plots, visualization with seaborn in data science, data visualization with seaborn, data visualization in python using seaborn, python data analytics, learn python for data science, seaborn visualization, Python seaborn tutorial
Id: WJ2ctnxvpps
Channel Id: undefined
Length: 15min 20sec (920 seconds)
Published: Sun Dec 17 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.