Git Product home page Git Product logo

ex-08-data-visualization_1's Introduction

Ex-08-Data-Visualization-

AIM

To Perform Data Visualization on a complex dataset and save the data to a file.

Explanation

Data visualization is the graphical representation of information and data. By using visual elements like charts, graphs, and maps, data visualization tools provide an accessible way to see and understand trends, outliers, and patterns in data.

ALGORITHM

STEP 1

Read the given Data

STEP 2

Clean the Data Set using Data Cleaning Process

STEP 3

Apply Feature generation and selection techniques to all the features of the data set

STEP 4

Apply data visualization techniques to identify the patterns of the data.

CODE

DEVELOPED BY: HARISH RAGAVENDRA S
RESISTER NO: 212222230045
import pandas as pd
import seaborn as sns
df=sns.load_dataset("tips")
df
df.isnull().sum()
import matplotlib.pyplot as plt
plt.figure(figsize=(7,7))
plt.title("Data with outliers")
df.boxplot()
plt.show()
cols=['size','tip','total_bill']
q1=df.quantile(0.75)
q3=df.quantile(0.25)
iqr=q3-q1
low=q1+1.5*iqr
high=q3-1.5*iqr
df2=df[(df[cols]>low)&(df[cols]<high)]
df2
df2=df2.drop(['sex','smoker','day','time'],axis=1)
df2
import seaborn as sns
import matplotlib.pyplot as plt
sns.barplot(x=df["day"],y=df["total_bill"],hue=df["day"])
plt.title("TOTAL BILL VS DAY")
plt.show()
sns.barplot(x=df["smoker"],y=df["tip"],hue=df["day"])
plt.title("What is the average tip amount given by smokers and non-smokers")
plt.show()
df["tip_percent"] = df["tip"] / df["total_bill"]
sns.scatterplot(x=df['size'],y=df['tip_percent'],data=df)
plt.title("Tip Percentage by Dining Party Size")
sns.boxplot(x=df['sex'], y=df['tip'],hue=df['sex'])
plt.title("Tips based on gender")
sns.scatterplot(x=df['day'],y=df['total_bill'],hue=df['day'])
plt.legend(loc="best")
plt.title("Total bill amount by day of the week")
sns.histplot(data=df, x="total_bill", hue="time", element="step", stat="density")
plt.title("Distribution of Total Bill Amounts by Time of Day")
sns.barplot(x=df['size'],y=df['total_bill'],hue=df['size'])
plt.title("Average Total Bill Amount by Dining Party Size")
plt.show()
sns.boxplot(x="day", y="tip", data=df)
plt.title("Tip Amount by Day of Week")
plt.show()
sns.violinplot(x="time", y="tip", data=df)
plt.title("Tip Amount by Time of Day")
plt.show()
sns.scatterplot(x="total_bill", y="tip", data=df)
plt.title("Correlation between Tip Amount and Total Bill Amount")
plt.show()

OUPUT

Screenshot 2023-05-30 212225 Screenshot 2023-05-30 212235 Screenshot 2023-05-30 212249 Screenshot 2023-05-30 212257 Screenshot 2023-05-30 212305 Screenshot 2023-05-30 212318 Screenshot 2023-05-30 212325 Screenshot 2023-05-30 212341 Screenshot 2023-05-30 212356 Screenshot 2023-05-30 212405 Screenshot 2023-05-30 212417 Screenshot 2023-05-30 212426 Screenshot 2023-05-30 212436 Screenshot 2023-05-30 212444 Screenshot 2023-05-30 212452

RESULT:

Thus the experiment executed sucessfully.

ex-08-data-visualization_1's People

Contributors

harish-ragavendra-25 avatar karthi-govindharaju avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.