<jupyter_start><jupyter_text>Assignment 01: Draw a pair plot using seaborn library*The comments/sections provided are your cues to perform the assignment. You don't need to limit yourself to the number of rows/cells provided. You can add additional rows in each section to add more lines of code.**If at any point in time you need help on solving this assignment, view our demo video to understand the different steps of the code.***Happy coding!*** * *  Draw a pair plot using seaborn library**DESCRIPTION****Problem:****Analyze the “auto mpg data” and draw a pair plot using seaborn library for mpg, weight, and origin.**Sources:(a) Origin:  This dataset was taken from the StatLib library maintained at Carnegie Mellon University.+ Number of Instances: 398+ Number of Attributes: 9 including the class attribute+ Attribute Information:    + mpg: continuous    + cylinders: multi-valued discrete    + displacement: continuous    + horsepower: continuous    + weight: continuous    + acceleration: continuous    + model year: multi-valued discrete    + origin: multi-valued discrete    + car name: string (unique for each instance)<jupyter_code>#import required libraries
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#to view the plot in notebook
%matplotlib inline
#importing the auto dataset
df_auto_dataset = pd.read_csv('D:\\NIPUN_SC_REC\\3_Practice_Project\\Course_5_Data Science with Python\\Practice_projects\\Lesson 10.7_practice project\\auto_data.csv')
#view the top 5 records
df_auto_dataset.head()
#write a user defined function for origin
#1-USA, 2-Europe, 3-Asia
def origin(num):
    if num==1:
        return 'USA'
    elif num==2:
        return 'Europe'
    else:
        return 'Asia'        

#use apply function
df_auto_dataset['origin']=df_auto_dataset['origin'].apply(origin)
#view first 30 data points after applying the user defined function to dataset
df_auto_dataset.head(30)
#draw the pair plot using sns for mpg, weight, origin with hue origin, set the size to 4
#note: hue is variable in dataset to map plot aspects to sifferent colors
sns.pairplot(df_auto_dataset[['mpg','weight','origin']],hue='origin',height=4)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0817067635043123, 'fraction_numerical': 0.01044030866999546, 'mean_word_length': 4.8, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '84768', 'license': 'MIT', 'n_tokens_mistral': 638, 'n_tokens_neox': 595, 'n_words': 260, 'path': '10.7 Draw a pair plot using seaborn library/Draw a pair plot using seaborn library.ipynb', 'repo_name': 'mohamedsuhaib/Data-Science-with-Python', 'size': '2203'}