Created
May 2, 2025 01:01
-
-
Save IghorArruda/a0922d2de67cec8650e95c0e54f66216 to your computer and use it in GitHub Desktop.
Análise de Dados de Vendas com Python (Pandas) - Script Básico
This file contains hidden or 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
import pandas as pd | |
# Dados fictícios (simulando um CSV) | |
dados = { | |
'Data': ['2023-01-01', '2023-01-02', '2023-01-03'], | |
'Produto': ['Notebook', 'Smartphone', 'Tablet'], | |
'Quantidade': [5, 12, 8], | |
'Regiao': ['Sudeste', 'Nordeste', 'Sul'] | |
} | |
df = pd.DataFrame(dados) | |
# Análise rápida | |
print("📊 Total por Região:") | |
print(df.groupby('Regiao')['Quantidade'].sum()) | |
# Salvar gráfico (opcional) | |
df.groupby('Regiao')['Quantidade'].sum().plot(kind='bar', title='Vendas por Região') | |
import matplotlib.pyplot as plt | |
plt.savefig('vendas_por_regiao.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment