Learn practical skills, build real-world projects, and advance your career

Categorical Data :

The two main categories of categorical data are nominal and ordinal.

In nominal categorical data attribute, there is no concept of ordering amongst the values of that attribute.

Ordinal categorical attributes have some sense or notion of order amongst its values.

The common plots used to visualize categorical data are

**1.Count Plot
2.Bar Plot
3.Box Plot
4.Violin Plot **

import numpy as np 
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import seaborn as sns
import matplotlib.pyplot as plt

%matplotlib inline
# loading dataset 
df = pd.read_csv("../input/widsdatathon2020/training_v2.csv")
print([c for c in df.columns if (1<df[c].nunique()) & (df[c].dtype != np.number)& (df[c].dtype != int) ])
['ethnicity', 'gender', 'hospital_admit_source', 'icu_admit_source', 'icu_stay_type', 'icu_type', 'apache_3j_bodysystem', 'apache_2_bodysystem']
categorical_cols =  ['hospital_id',
 'ethnicity', 'gender', 'hospital_admit_source', 'icu_admit_source', 'icu_stay_type', 'icu_type', 'apache_3j_bodysystem', 'apache_2_bodysystem',"hospital_death","d1_heartrate_min" ,"d1_lactate_min","d1_resprate_min"]