I'm at the end of the IBM Data Analyst course, and I wanted to ask for a rating of a piece of code I wrote as a solution to its exercises from the final chapter. I know I could write it on the forum of the course, but I will finish it very soon and have no access to the forum before anyone will answer.
Exercises:
Create a stacked chart of median WorkWeekHrs and CodeRevHrs for the age group 30 to 35.

query = "SELECT WorkWeekHrs, CodeRevHrs FROM master WHERE Age BETWEEN 30 AND 35;"
dejtafrejm = pd.read_sql_query(query, conn)
newframe = pd.DataFrame()
newframe['WorkWeekHrs'] = dejtafrejm[['WorkWeekHrs']].median()
newframe['CodeRevHrs'] = dejtafrejm['CodeRevHrs'].median()
ax = newframe.plot(kind='bar', color=['Blue', 'Yellow'], stacked=True, figsize=(5, 4))
for container in ax.containers:
ax.bar_label(container, label_type='center')
plt.xticks([])
Create a horizontal bar chart using column MainBranch.
query = 'SELECT MainBranch FROM master'
df = pd.read_sql_query(query, conn)
df[['Total']] = 1
newdf = dief.groupby('MainBranch', axis=0).sum().transpose()
ax = newdf.plot(kind='barh', figsize=(15, 6))
for container in ax.containers:
ax.bar_label(container)


