710722205049 SRIHARI S
[Link].3
Creating Histogram
Aim
To write a python program to create histogram of age column.
Algorithm
STEP 1: Start the program.
STEP 2: Import the dataset using pandas.
STEP 3: Create the histogram using matplotlib library.
STEP 4: Create the bar chart using season by using seaborn library.
STEP 5: Stop the program.
Program
import pandas as pd
import [Link] as plt
import seaborn as sns
data = pd.read_csv('[Link]')
age_bins = [0, 20, 30, 40, 50, 60, 100]
age_labels = ['<20', '20-29', '30-39', '40-49', '50-59', '60+']
data['AgeGroup'] = [Link](data['Age'], bins=age_bins, labels=age_labels)
[Link](figsize=(10, 6))
[Link](data=data, x='AgeGroup', hue='Health', multiple='dodge', shrink=0.8)
[Link]('Histogram of Age Groups vs Health Status')
[Link]('Age Group')
[Link]('Count')
[Link]()
[Link](figsize=(10, 6))
[Link](data=data, x='AgeGroup', y='Age', hue='Health')
22UCB906/EXPLORATORY DATA ANALYSIS
710722205049 SRIHARI S
Output:
Result
Thus, the python program to create histogram of age column is executed and verified successfully.
22UCB906/EXPLORATORY DATA ANALYSIS