Created
October 29, 2019 16:21
-
-
Save fclesio/9c93d58289f75ea5bb740a1218a4f885 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 get_graph_ts(df, column, title, label): | |
"""Generate graph of a Time Series | |
Parameters | |
---------- | |
df : Pandas Dataframe | |
Dataframe with Brasileirão data | |
column : string | |
Column with the metric to be ploted | |
title : string | |
Graph title to be displayed | |
label : string | |
Name of the series that will be placed | |
as legend | |
Returns | |
------- | |
""" | |
plt.figure(figsize=(20,10)) | |
plt.title(title) | |
plt.xlabel('Years') | |
plt.ylabel('Gini Index') | |
plt.plot(df[column], label=label) | |
plt.xticks(gini_df.index) | |
get_graph_ts(gini_df, | |
'gini', | |
'Gini Index in Brasileirão', | |
'Gini Index', | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment