How to use seaborn to visualise a Pandas dataframe?
DATA VISUALIZATION

How to use seaborn to visualise a Pandas dataframe?

How to use seaborn to visualise a Pandas dataframe?

This recipe helps you use seaborn to visualise a Pandas dataframe

0
In [2]:
## How to use seaborn to visualise a Pandas dataframe
def Snippet_111():
    print()
    print(format('How to use seaborn to visualise a Pandas dataframe','*^82'))

    import warnings
    warnings.filterwarnings("ignore")

    # load libraries
    import pandas as pd
    import random
    import matplotlib.pyplot as plt
    import seaborn as sns

    df = pd.DataFrame()
    df['x'] = random.sample(range(1, 50), 27)
    df['y'] = random.sample(range(1, 100), 27)
    print(); print(df.head())
    print(); print(df.tail())

    # Scatterplot
    sns.lmplot('x', 'y', data=df, fit_reg=False)

    # Scatterplot with regression line
    sns.lmplot('x', 'y', data=df, fit_reg=True)

    # Density Plot
    sns.kdeplot(df.y); plt.show()
    sns.kdeplot(df.y, df.x); plt.show()
    sns.distplot(df.x); plt.show()

    # Histogram
    plt.hist(df.x, alpha=.3)
    sns.rugplot(df.x)
    plt.show()

    # Boxplot
    sns.boxplot([df.y, df.x]); plt.show()

    # Violin Plot
    sns.violinplot([df.y, df.x]); plt.show()

    # Heatmap
    sns.heatmap([df.y, df.x], annot=False, fmt="d"); plt.show()

    # Clustermap
    sns.clustermap(df); plt.show()

Snippet_111()
****************How to use seaborn to visualise a Pandas dataframe****************

    x   y
0  32  72
1  27  58
2  42   7
3   5  55
4  45  68

     x   y
22   9  94
23  20  16
24  13  62
25  22  78
26  44  15

Relevant Projects

Human Activity Recognition Using Smartphones Data Set
In this deep learning project, you will build a classification system where to precisely identify human fitness activities.

Forecast Inventory demand using historical sales data in R
In this machine learning project, you will develop a machine learning model to accurately forecast inventory demand based on historical sales data.

Predict Churn for a Telecom company using Logistic Regression
Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

German Credit Dataset Analysis to Classify Loan Applications
In this data science project, you will work with German credit dataset using classification techniques like Decision Tree, Neural Networks etc to classify loan applications using R.

Data Science Project-All State Insurance Claims Severity Prediction
Data science project in R to develop automated methods for predicting the cost and severity of insurance claims.

Machine Learning or Predictive Models in IoT - Energy Prediction Use Case
In this machine learning and IoT project, we are going to test out the experimental data using various predictive models and train the models and break the energy usage.

Sequence Classification with LSTM RNN in Python with Keras
In this project, we are going to work on Sequence to Sequence Prediction using IMDB Movie Review Dataset​ using Keras in Python.

Music Recommendation System Project using Python and R
Machine Learning Project - Work with KKBOX's Music Recommendation System dataset to build the best music recommendation engine.

Ecommerce product reviews - Pairwise ranking and sentiment analysis
This project analyzes a dataset containing ecommerce product reviews. The goal is to use machine learning models to perform sentiment analysis on product reviews and rank them based on relevance. Reviews play a key role in product recommendation systems.

Predict Macro Economic Trends using Kaggle Financial Dataset
In this machine learning project, you will uncover the predictive value in an uncertain world by using various artificial intelligence, machine learning, advanced regression and feature transformation techniques.