<jupyter_start><jupyter_text>Data Visualization can be done by implementing Python libraries First import different libraries like pandas, numpy, seaborn, matplotlib<jupyter_code>import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline<jupyter_output><empty_output><jupyter_text>Read data from the csv file<jupyter_code>data = pd.read_csv("heart_failure_clinical_records_dataset.csv")
data<jupyter_output><empty_output><jupyter_text>Plot the graphs using different attributes of the dataset<jupyter_code>plt.bar(x=data['age'],height=data['ejection_fraction'])
plt.xlabel('Age')
plt.ylabel('Ejection Fraction')
plt.figure(figsize=(7,4))
plt.bar(x=data['age'],height=data['platelets'])
plt.xlabel('Age')
plt.ylabel('Platelets level')
plt.figure(figsize=(7,4))
plt.bar(x=data['age'],height=data['serum_sodium'])
plt.xlabel('Age')
plt.ylabel('Serum Sodium')
plt.figure(figsize=(7,4))
plt.bar(x=data['age'],height=data['creatinine_phosphokinase'])
plt.xlabel('Age')
plt.ylabel('Creatinine Phosphokinase')
plt.figure(figsize=(7,4))
plt.bar(x=data['age'],height=data['serum_creatinine'])
plt.xlabel('Age')
plt.ylabel('Serum Creatinine')
x = data.age
y = data.serum_sodium
plt.scatter(x,y)
plt.show()
x = data.age
y = data.platelets
plt.scatter(x,y)
plt.show()
x = data.age
y = data.ejection_fraction
plt.scatter(x,y)
plt.show()
x = data.age
y = data.creatinine_phosphokinase
plt.scatter(x,y)
plt.show()
x = data.age
y = data.serum_creatinine
plt.scatter(x,y)
plt.show()
pt = sns.distplot(data['platelets'])
an = sns.distplot(data['anaemia'])
cp = sns.distplot(data['creatinine_phosphokinase'])
ef = sns.distplot(data['ejection_fraction'])
 sc = sns.distplot(data['serum_creatinine'])
 ss = sns.distplot(data['serum_sodium'])
data.boxplot(by ='anaemia', column =['serum_sodium'], grid = False) 
data.boxplot(by ='high_blood_pressure', column =['platelets'], grid = False) 
data.boxplot(by ='serum_creatinine', column =['diabetes'], grid = False)<jupyter_output><empty_output><jupyter_text>Plot the Heatmap<jupyter_code>fig, ax = plt.subplots(figsize=(8,5))
sns.heatmap(data.corr(), center=0, cmap='Blues')
ax.set_title('Heatmap')
fig, ax = plt.subplots(figsize=(10,8))
sns.heatmap(data.corr(), center=0, cmap='BrBG', annot=True)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup