Created
April 12, 2019 01:21
-
-
Save ChicagoDev/08e135ba1337e933c540330d55117b6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getMvp(self, N): | |
""" | |
Our Minimum Viable Product. Creates a bar graph with the top | |
N highest trafficked MTA stations. | |
:param N: Number of top stations (e.g. Top 10, Top 5) to use in the graph | |
:type N: int | |
:return: Seaborn figure to be shown with plt.show() | |
""" | |
top_N = self.n_largest(N) | |
top_N = top_N.div(1000000) | |
top_ten_indexed = top_N.reset_index() | |
mvp_chart = sb.barplot(x=top_ten_indexed['STATION'], y=top_ten_indexed['DAILY_ENTRIES']) | |
sb.despine() | |
plt.ylabel("People (in millions)", fontsize=10) | |
plt.xlabel("Station", fontsize=10, labelpad=10) | |
plt.title("Top "+str(N)+" MTA Stations Ridership Volume") | |
plt.xticks(fontsize = 8, rotation=80) | |
return mvp_chart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment