Having the following content in my .xls file:
Belo Horizonte - MG 2278.8
Porto Alegre - RS 1647.8
Recife - PE 2434.9
Rio de Janeiro - RJ 1653.6
Salvador - BA 2324.1
São Paulo - SP 2227.5
Total of areas 14640.1
How to plot data from the .xls file, transforming it into a chart (of any type)?
I was able to read the data with the following code:
import openpyxl
import matplotlib.pyplot as plt
book = openpyxl.load_workbook('planilha.xlsx')
sheet = book.active
celulas = sheet['A2':'B8']
for c1, c2 in celulas:
print("{0:8} {1:8}".format(c1.value, c2.value))
But I do not know how to proceed.
I thought about using the matplotlib library, but as I said above, I do not know how to proceed.