Module create_graphs.py

Contains functions that create and save plots in png format.

create_graphs.create_graph_average_scores_by_region(dataframe: DataFrame) <module 'matplotlib.pyplot' from '/home/vitor/.local/lib/python3.11/site-packages/matplotlib/pyplot.py'>

Creates a grouped bar graph with the average scores by region

Parameters:

df (pd.DataFrame) – The dataframe with the needed data, the data must be preprocessed

Returns:

The graph plot object

Return type:

plt

Example

>>> import pandas as pd
>>> data = {'Region': ['North', 'South', 'East'],
...         'Category': ['Category A', 'Category B', 'Category C'],
...         'Average Score': [4.2, 3.8, 4.1]}
>>> df = pd.DataFrame(data)
>>> plot = create_graph_average_scores_by_region(df)
>>> plot.__class__.__name__ == "module"
True
create_graphs.create_graph_non_attendance(dataframe: DataFrame) <module 'matplotlib.pyplot' from '/home/vitor/.local/lib/python3.11/site-packages/matplotlib/pyplot.py'>

Creates a horizontal bar graph with the non-attendance rate of each course

Parameters:

dataframe (pd.DataFrame) –

Returns:

The graph plot object

Return type:

plt

Example

>>> import pandas as pd
>>> data = {'Área de Avaliação': ['Course A', 'Course B', 'Course C'],
...         'Taxa de Desistência Média': [5.2, 3.8, 7.1]}
>>> df = pd.DataFrame(data)
>>> plot = create_graph_non_attendance(df)
>>> plot.__class__.__name__ == "module"
True
create_graphs.create_map_plot_average_score_by_state(geodataframe: GeoDataFrame) <module 'matplotlib.pyplot' from '/home/vitor/.local/lib/python3.11/site-packages/matplotlib/pyplot.py'>

Creates a map containing average Enade scores of each state

Parameters:

geodataframe (gpd.GeoDataFrame) – The map data with needed information

Returns:

The graph plot object

Return type:

plt