Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Carlos Gutierrez - DS-Sprint02 #29

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

carlos-gutier
Copy link

No description provided.

@waterFlowin
Copy link

Sprint Challenge Code Review

Week 2 - Storytelling with Data


Part 0 — Run this starter code


Part 1 — What's the breakdown of guests’ occupations per year?

Code review

What went well:

  • Perfect:
ct = pd.crosstab(df.Year, df.Occupation, normalize='index')
ct = ct*100
ct

What could be better:

  • Nothing. Reminder to start building the habit to add clean/clear comments that explain your lines of code:
# Useful words about the line of code below
ct = pd.crosstab(df.Year, df.Occupation, normalize='index')
#  This line does x, y, z
ct = ct*100
# Some result title
ct


Part 2 — Recreate this explanatory visualization:

Code review

What went well:

  • Perfect:
ct = ct.drop(columns=['Other'])

Alternate, shorter option for Seaborn plot:

import seaborn as sns
assert sns.__version__ == '0.9.0'

sns.relplot(data=ct, kind='line')
plt.text(x=1998, y=1.1, s="Who Got To Be On 'The Daily Show'?", fontweight='bold')
plt.text(x=1998, y=1.0, s='Occupation of guests, by year')


Part 3 — Who were the top 10 guests on The Daily Show?

Code review

What went well:

  • I like that you did a barh plot here. Helps with readability when names are horizontal. I don't know why its not readable on github. Colab compatibility issues maybe:
df.Guest.value_counts().head(10).plot(kind='barh')

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants