Skip to content

Instantly share code, notes, and snippets.

@IghorArruda
Created May 2, 2025 01:01
Show Gist options
  • Save IghorArruda/a0922d2de67cec8650e95c0e54f66216 to your computer and use it in GitHub Desktop.
Save IghorArruda/a0922d2de67cec8650e95c0e54f66216 to your computer and use it in GitHub Desktop.
Análise de Dados de Vendas com Python (Pandas) - Script Básico
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