Example: bankruptcy

Seaborn - Tutorialspoint

Seaborn i Seaborn ii About the Tutorial Seaborn is an open source, BSD-licensed Python library providing high level API for visualizing the data using Python programming language. Audience This tutorial takes you through the basics and various functions of Seaborn . I t is specifically useful for people working on data analysis. After com pleting this tutorial, you will find yourself at a m oderate level of expertise from where you can take yourself to higher levels of expertise.

Importing Libraries Let us start by importing Pandas, which is a great library for managing relational (table-format) datasets. Seaborn comes handy when dealing with DataFrames, which is most widely used data structure for data analysis. The following command will help you import Pandas: # Pandas for managing datasets import pandas as pd

Tags:

  Importing, Tutorialspoint

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Seaborn - Tutorialspoint

1 Seaborn i Seaborn ii About the Tutorial Seaborn is an open source, BSD-licensed Python library providing high level API for visualizing the data using Python programming language. Audience This tutorial takes you through the basics and various functions of Seaborn . I t is specifically useful for people working on data analysis. After com pleting this tutorial, you will find yourself at a m oderate level of expertise from where you can take yourself to higher levels of expertise.

2 Prerequisites You should have a basic understanding of computer programming terminologies. A basic understanding of Python and any of the programming languages is a plus. Seaborn library is built on top of Matplotlib. Having basic idea of Matplotlib will help you understand this tutorial in a better way. Copyright & Disclaimer C opyright 2017 by Tutorials Point (I ) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I ) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any m anner without written consent of the publisher.

3 W e strive to update the contents of our website and tutorials as tim ely and as precisely as possible, however, the contents m ay contain inaccuracies or errors. Tutorials Point (I ) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or com pleteness of our website or its contents including this tutorial. I f you discover any errors on our website or in this tutorial, please notify us at Seaborn iii Table of Contents About the Tutori al .. ii Audi ii Prerequi si tes .. ii Copyri ght & Dis clai mer.

4 Ii Tabl e of iii 1. Seaborn Introdu ction ..6 Seaborn Vs Matpl otli b ..6 2. Seaborn Environment Ins talli ng Seaborn and getti ng s tarted ..8 3. Seaborn importing Dat asets and Libraries .. 10 Importi ng Li brari es .. 10 Importi ng Datas ets .. 10 4. Seaborn Figure Aesthetic .. 13 Seaborn Fi gure Styl es .. 16 Removi ng Axes Spi 17 Overri di ng the El 18 Scali ng Pl ot El ements .. 21 5. Seaborn Color P alette .. 23 Buil di ng Col or Pal 23 Quali tati ve Col or Pal 24 Sequen ti al Col or Pal ettes.

5 25 Di vergi ng Col or Pal ette .. 25 Seaborn iv Setti ng the D efaul t Col or Pal ette .. 26 Pl otti ng Uni variate Di s tri buti on .. 27 6. Seaborn Histogram .. 29 7. Seaborn Kernel Density Estimates .. 31 Fi tti ng Parametri c Dis tri buti on .. 31 Pl otti ng Bi variate Di s tri buti on .. 32 Scatter Pl 33 Hexbi n Pl ot .. 34 Kernel Dens i ty Es ti mati on .. 35 8. Seaborn Visu alizing P airwise 37 Axes .. 37 9. Seaborn Plotting C ategorical Data ..1 Categori cal Scatter Pl 10. Seaborn Distribution of Ob servation Box Pl ots.

6 6 Vi oli n Pl 11. Seaborn Statistical Estim ation .. 12 Bar Pl ot .. 12 Poi nt Pl ots .. 14 12. Seaborn Plotting Wide Form 16 13. Seaborn Mu lti Panel C ategorical P lots .. 20 Factorpl ot .. 20 What is Facet Gri d? .. 22 Seaborn v 14. Seaborn Linear Relationsh ips .. 28 Functi ons to Draw Li near Regres si on Model s .. 28 Fi tti ng Di fferent Ki nds of Models .. 31 15. Seaborn Facet Grid .. 35 Pl otti ng Small Mul ti pl es of Data Subs 35 16. Seaborn Pair Grid .. 40 Seaborn 6 I n the world of Analytics, the best way to get insights is by visualizing the data.

7 Data can be visualized by representing it as plots which is easy to understand, explore and grasp. Such data helps in drawing the attention of key elements. To analyse a set of data using Python, we m ake use of Matplotlib, a widely im plemented 2D plotting library. Likewise, Seaborn is a visualization library in Python. I t is built on top of Matplotlib. Seaborn Vs Matplotlib I t is summarized that if Matplotlib tries to make easy things easy and hard things possible , Seaborn tries to make a well-defined set of hard things easy too.

8 Seaborn helps resolve the two m ajor problems faced by Matplotlib; the problems are: Default Matplotlib parameters W orking with data fram es As Seaborn compliments and extends Matplotlib, the learning curve is quite gradual. I f you know Matplotlib, you are already half way through Seaborn . Important Features of Seaborn Seaborn is built on top of Python s core visualization library Matplotlib. I t is m eant to serve as a complement, and not a replacement. However, Seaborn comes with some very im portant features. Let us see a few of them here.

9 The features help in - Built in themes for styling m atplotlib graphics Visualizing univariate and bivariate data Fitting in and visualizing linear regression m odels Plotting statistical tim e series data Seaborn works well with Num Py and Pandas data structures I t com es with built in them es for styling Matplotlib graphics I n m ost cases, you will still use Matplotlib for sim ple plotting. The knowledge of Matplotlib is recommended to tweak Seaborn s default plots. 1. Seaborn Introduction Seaborn 7 Seaborn 8 I n this chapter, we will discuss the environment setup for Seaborn .

10 Let us begin with the installation and understand how to get started as we m ove ahead. Installing Seaborn and getting started I n this section, we will understand the steps involved in the installation of Seaborn . Using Pip Installer To install the latest release of Seaborn , you can use pip: pip install Seaborn For Windows, Linux & Mac using Anaconda Anaconda (from .io) is a free Python distribution for SciPy stack. I t is also available for Linux and Mac. I t is also possible to install the released version using conda: conda install Seaborn To install the development version of Seaborn directly from github pip install git+ Dependencies C onsider the following dependencies of Seaborn : Python or + num py scipy pandas m atplotlib 2.


Related search queries