Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fclesio
Created October 29, 2019 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fclesio/9c93d58289f75ea5bb740a1218a4f885 to your computer and use it in GitHub Desktop.
Save fclesio/9c93d58289f75ea5bb740a1218a4f885 to your computer and use it in GitHub Desktop.
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