text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

udemy_courses = pd.read_csv('/kaggle/input/udemy-courses/udemy_courses.csv', parse_dates=['published_timestamp'])

udemy_courses['price'] = udemy_courses['price'].str.replace('Free', '0').str.replace('TRUE', '0')
udemy_courses['price'] = udemy_courses['price'].astype('float')
udemy_courses['number_of_contents'] = udemy_courses['content_duration'].str.extract('([\\d\\.]+)\\s[\\w]+').astype('float')
udemy_courses['content_duration_type'] = udemy_courses['content_duration'].str.extract('[\\d\\.]+\\s([\\w]+)')
udemy_courses.drop('content_duration', axis=1, inplace=True)

udemy_courses.dropna(inplace=True)

g = sns.catplot(x='subject', data=udemy_courses, kind='count', hue='is_paid')
g.fig.suptitle('free/paid categories comparison', y=1.03)
plt.xticks(rotation=90)
plt.show()