Starting with graphics visualization

dataset:
http://www.dadosabertos.pe.gov.br/PortalDadosAbertos/public/pages/recurso/recursoConsultaDetalhada.jsf#

Let's talk now about the MATPLOTLIB library, I believe it is the simplest to start, the %matplotlib inline command is used to run the library inside jupyter IDE, as we always import the pandas and numpy and load the csv file with the data


In addition to the .shape function we can see the size of the dataset using the len () function as shown below


I want to plot a graph with the 5 cities with the most mortality, so I create the variable that receives a new dataset 'cidadesMaisObtos' I use sort_values () passing as argument the numeric column to be organized, and the argument ascending = False informs that I want the grouping downwards, head (5) and to pick up only the first 5




To plot this graph I chose to build the plot_grafico () function, in it I create the plot routine, described below, and then execute the function,


as inside the function plot_grafico () I created the object fig, I can use the savefig () function to save an image of the graph.