122 lines
3.0 KiB
Plaintext
122 lines
3.0 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"id": "c8d9a033",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import pandas as pd\n",
|
|
"import numpy as np \n",
|
|
"import glob\n",
|
|
"import os \n",
|
|
"from datetime import date\n",
|
|
"\n",
|
|
"# Set the path to the folder containing CSV files\n",
|
|
"folder_path = r\"C:\\Users\\joao.herculano\\Documents\\estudo cobertura alta 1107\\DRAFT\"\n",
|
|
"\n",
|
|
"# Pattern to match all CSV files\n",
|
|
"csv_files = glob.glob(os.path.join(folder_path, '*.csv'))\n",
|
|
"\n",
|
|
"# Read and concat all CSVs\n",
|
|
"df_draft = pd.concat([pd.read_csv(file) for file in csv_files], ignore_index=True)\n",
|
|
"\n",
|
|
"df_draft.shape\n",
|
|
"\n",
|
|
"today = date.today()\n",
|
|
"\n",
|
|
"df_draft = df_draft[df_draft['Dias sem venda']>40]\n",
|
|
"\n",
|
|
"df_draft = df_draft[df_draft['Estoque Atual']>0]\n",
|
|
"\n",
|
|
"df_draft['Total estoque'] = df_draft['Preço Sell In'] * df_draft['Estoque Atual']\n",
|
|
"\n",
|
|
"df_draft['Total trânsito'] = df_draft['Preço Sell In'] * df_draft['Estoque em Transito']\n",
|
|
"\n",
|
|
"df_draft.sort_values(by='Total estoque',ascending=False,inplace=True)\n",
|
|
"\n",
|
|
"df_draft['Promoção'] = np.where(~df_draft['Promoção Próximo Ciclo'].isna(),'SIM',np.where(~df_draft['Promoção Próximo Ciclo + 1'].isna(),'SIM','NÃO'))\n",
|
|
"\n",
|
|
"df_draft['Projeção Próximo Ciclo + 1'] = df_draft['Projeção Próximo Ciclo + 1']-df_draft['Projeção Próximo Ciclo']\n",
|
|
"\n",
|
|
"df_draft2 = df_draft\n",
|
|
"\n",
|
|
"\n",
|
|
"df_draft2.to_excel(f'C:\\\\Users\\\\joao.herculano\\\\Documents\\\\estudo cobertura alta 1107\\\\draft{today}2.xlsx',index=False)\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 38,
|
|
"id": "4538e881",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"np.int64(1884)"
|
|
]
|
|
},
|
|
"execution_count": 38,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"df_draft['Promoção Próximo Ciclo'].isna().sum()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 41,
|
|
"id": "71240beb",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"np.int64(12480)"
|
|
]
|
|
},
|
|
"execution_count": 41,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"df_draft['Estoque Atual'].sum()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "6cda199e",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.13.2"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|