diff options
Diffstat (limited to '2023-2/L04/mitsuo/simple.ipynb')
| -rw-r--r-- | 2023-2/L04/mitsuo/simple.ipynb | 1768 |
1 files changed, 1768 insertions, 0 deletions
diff --git a/2023-2/L04/mitsuo/simple.ipynb b/2023-2/L04/mitsuo/simple.ipynb new file mode 100644 index 0000000..1e90256 --- /dev/null +++ b/2023-2/L04/mitsuo/simple.ipynb @@ -0,0 +1,1768 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "# pd.set_option('display.max_rows', None)\n", + "pd.set_option('display.max_columns', None)\n", + "pd.set_option('display.expand_frame_repr', False)\n", + "pd.set_option('display.float_format', '{:,.2f}'.format)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "productos = pd.read_csv(\"../Productos2.csv\", names=(\"product_id\", \"product_name\", \"price\", \"uses_credit\"), encoding='latin1')\n", + "clientes = pd.read_csv(\"../Clientes2.csv\", names=(\"client_id\", \"client_name\", \"phonenumber\", \"credit\"))\n", + "pedidos = pd.read_csv(\"../Pedidos2.csv\", names=(\"product_id\", \"client_id\", \"qty\"))\n", + "\n", + "clientes = clientes.set_index('client_id')\n", + "productos = productos.set_index('product_id')\n", + "# pedidos['date'] = pd.to_datetime(pedidos['date'], format=\"%d/%m/%Y\")" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>product_name</th>\n", + " <th>price</th>\n", + " <th>uses_credit</th>\n", + " </tr>\n", + " <tr>\n", + " <th>product_id</th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>BIT-434</th>\n", + " <td>Campana Extractora modelo Glass</td>\n", + " <td>375.09</td>\n", + " <td>S</td>\n", + " </tr>\n", + " <tr>\n", + " <th>SSE-115</th>\n", + " <td>Refrigeradora CoolStyle 311N Steel</td>\n", + " <td>3,243.58</td>\n", + " <td>S</td>\n", + " </tr>\n", + " <tr>\n", + " <th>NMV-644</th>\n", + " <td>Lavadora Automatica</td>\n", + " <td>3,272.48</td>\n", + " <td>S</td>\n", + " </tr>\n", + " <tr>\n", + " <th>MLE-193</th>\n", + " <td>Cocina a gas Ingenious</td>\n", + " <td>2,779.41</td>\n", + " <td>S</td>\n", + " </tr>\n", + " <tr>\n", + " <th>YYK-309</th>\n", + " <td>Refrigeradora Door in Door</td>\n", + " <td>4,079.44</td>\n", + " <td>S</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " product_name price uses_credit\n", + "product_id \n", + "BIT-434 Campana Extractora modelo Glass 375.09 S\n", + "SSE-115 Refrigeradora CoolStyle 311N Steel 3,243.58 S\n", + "NMV-644 Lavadora Automatica 3,272.48 S\n", + "MLE-193 Cocina a gas Ingenious 2,779.41 S\n", + "YYK-309 Refrigeradora Door in Door 4,079.44 S" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "productos.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>client_name</th>\n", + " <th>phonenumber</th>\n", + " <th>credit</th>\n", + " </tr>\n", + " <tr>\n", + " <th>client_id</th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>79464412</th>\n", + " <td>PORTUGAL RAFFO ALEXANDER</td>\n", + " <td>3902394</td>\n", + " <td>10000</td>\n", + " </tr>\n", + " <tr>\n", + " <th>16552775</th>\n", + " <td>YALLICO PAREDES LOURDES CARMELA</td>\n", + " <td>960176666</td>\n", + " <td>20000</td>\n", + " </tr>\n", + " <tr>\n", + " <th>20864087</th>\n", + " <td>ZEGARRA CASANOVA ESTEFANIA</td>\n", + " <td>2639311</td>\n", + " <td>10000</td>\n", + " </tr>\n", + " <tr>\n", + " <th>94326707</th>\n", + " <td>CHANG SEGURA ANGEL</td>\n", + " <td>984185862</td>\n", + " <td>10000</td>\n", + " </tr>\n", + " <tr>\n", + " <th>73786035</th>\n", + " <td>ORTIZ EPIQUEN HENRY ISRAEL</td>\n", + " <td>6873908</td>\n", + " <td>20000</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " client_name phonenumber credit\n", + "client_id \n", + "79464412 PORTUGAL RAFFO ALEXANDER 3902394 10000\n", + "16552775 YALLICO PAREDES LOURDES CARMELA 960176666 20000\n", + "20864087 ZEGARRA CASANOVA ESTEFANIA 2639311 10000\n", + "94326707 CHANG SEGURA ANGEL 984185862 10000\n", + "73786035 ORTIZ EPIQUEN HENRY ISRAEL 6873908 20000" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "clientes.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>product_id</th>\n", + " <th>client_id</th>\n", + " <th>qty</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>0</th>\n", + " <td>JXD-139</td>\n", + " <td>50375303</td>\n", + " <td>6</td>\n", + " </tr>\n", + " <tr>\n", + " <th>1</th>\n", + " <td>CRU-009</td>\n", + " <td>50375303</td>\n", + " <td>5</td>\n", + " </tr>\n", + " <tr>\n", + " <th>2</th>\n", + " <td>YYK-309</td>\n", + " <td>22777006</td>\n", + " <td>3</td>\n", + " </tr>\n", + " <tr>\n", + " <th>3</th>\n", + " <td>OTS-581</td>\n", + " <td>42157219</td>\n", + " <td>5</td>\n", + " </tr>\n", + " <tr>\n", + " <th>4</th>\n", + " <td>AWB-345</td>\n", + " <td>13245501</td>\n", + " <td>1</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " product_id client_id qty\n", + "0 JXD-139 50375303 6\n", + "1 CRU-009 50375303 5\n", + "2 YYK-309 22777006 3\n", + "3 OTS-581 42157219 5\n", + "4 AWB-345 13245501 1" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pedidos.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "# reduce stock from products as orders come\n", + "\n", + "pedidos['served'] = False\n", + "for i, pedido in pedidos.iterrows():\n", + " cid = pedido['client_id']\n", + " pid = pedido['product_id']\n", + " qty = pedido['qty']\n", + " credit = clientes.loc[cid, 'credit']\n", + " price = productos.loc[pid, 'price']\n", + " uses_credit = productos.loc[pid, 'uses_credit']\n", + " total_cost = qty * price\n", + " if uses_credit == 'S' and credit >= total_cost:\n", + " clientes.loc[cid, 'credit'] -= total_cost\n", + " pedidos.loc[i, 'served'] = True\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "========================================================================================================================\n", + "client_id 79464412\n", + "client_name PORTUGAL RAFFO ALEXANDER\n", + "phonenumber 3902394\n", + "credit 5,782.30\n", + "Name: 0, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 NSM-283 2 1,873.62\n", + "1 JXD-139 4 2,344.08\n", + "========================================================================================================================\n", + "client_id 16552775\n", + "client_name YALLICO PAREDES LOURDES CARMELA\n", + "phonenumber 960176666\n", + "credit 3,716.33\n", + "Name: 1, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 AWB-345 6 4,802.22\n", + "1 CNN-411 5 11,481.45\n", + "========================================================================================================================\n", + "client_id 20864087\n", + "client_name ZEGARRA CASANOVA ESTEFANIA\n", + "phonenumber 2639311\n", + "credit 258.47\n", + "Name: 2, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 JFC-432 1 307.67\n", + "1 JDQ-505 6 9,433.86\n", + "========================================================================================================================\n", + "client_id 94326707\n", + "client_name CHANG SEGURA ANGEL\n", + "phonenumber 984185862\n", + "credit 10,000.00\n", + "Name: 3, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + "Empty DataFrame\n", + "Columns: [product_id, qty, total]\n", + "Index: []\n", + "========================================================================================================================\n", + "client_id 73786035\n", + "client_name ORTIZ EPIQUEN HENRY ISRAEL\n", + "phonenumber 6873908\n", + "credit 17,750.16\n", + "Name: 4, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 DEN-125 4 2,249.84\n", + "========================================================================================================================\n", + "client_id 31193794\n", + "client_name GARCIA YINO AMERICO WALDEMAR\n", + "phonenumber 986742314\n", + "credit 5,000.00\n", + "Name: 5, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + "Empty DataFrame\n", + "Columns: [product_id, qty, total]\n", + "Index: []\n", + "========================================================================================================================\n", + "client_id 96659352\n", + "client_name BRAVO VIZCARRA ROBERTO\n", + "phonenumber 985707065\n", + "credit 4,099.88\n", + "Name: 6, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 ADX-669 4 4,957.52\n", + "1 GBJ-693 3 942.60\n", + "========================================================================================================================\n", + "client_id 57690875\n", + "client_name NORABUENA VILLEGAS ARTURO RAFAEL\n", + "phonenumber 889013091\n", + "credit 2,232.17\n", + "Name: 7, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 CSZ-863 5 8,567.85\n", + "1 CIM-038 3 7,633.92\n", + "2 XTE-383 6 1,566.06\n", + "========================================================================================================================\n", + "client_id 69975105\n", + "client_name VALDERRAMA MENDOZA LUIS ADOLFO\n", + "phonenumber 977523461\n", + "credit 2,717.26\n", + "Name: 8, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 WZD-331 6 7,282.74\n", + "========================================================================================================================\n", + "client_id 54761731\n", + "client_name LOYOLA IBEROS ANGEL GUSTAVO\n", + "phonenumber 951334343\n", + "credit 291.26\n", + "Name: 9, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 DEV-433 3 8,096.22\n", + "1 ZVA-180 4 11,612.52\n", + "========================================================================================================================\n", + "client_id 67418025\n", + "client_name MOSCOSO SUELDO MARINA\n", + "phonenumber 7663823\n", + "credit 4,063.06\n", + "Name: 10, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 QUU-384 1 2,545.54\n", + "1 FEG-454 2 3,391.40\n", + "========================================================================================================================\n", + "client_id 77642521\n", + "client_name SORIA CASTILLO LUIS GUSTAVO\n", + "phonenumber 952902679\n", + "credit 5,736.66\n", + "Name: 11, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 QUU-384 5 12,727.70\n", + "1 YYU-726 2 1,535.64\n", + "========================================================================================================================\n", + "client_id 35584593\n", + "client_name LAM VIZCARDO MILAGROS YVONNE\n", + "phonenumber 6294058\n", + "credit 5,724.64\n", + "Name: 12, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 SSD-176 4 2,270.84\n", + "1 AVM-258 4 11,324.92\n", + "2 KCO-488 1 679.60\n", + "========================================================================================================================\n", + "client_id 43053402\n", + "client_name BENAVENTE ZIMIC MADELEINE ZKENIA\n", + "phonenumber 917252545\n", + "credit 2,633.12\n", + "Name: 13, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 YOT-530 2 1,883.46\n", + "1 VRR-793 2 483.42\n", + "========================================================================================================================\n", + "client_id 84165595\n", + "client_name SALAMANCA GAVIDIA ALEX\n", + "phonenumber 963178009\n", + "credit 304.52\n", + "Name: 14, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 DFJ-952 1 3,342.77\n", + "1 RDT-761 6 5,429.70\n", + "2 JFC-432 3 923.01\n", + "========================================================================================================================\n", + "client_id 89298238\n", + "client_name ALFARO PRECIADO JOHNNY\n", + "phonenumber 996727505\n", + "credit 319.74\n", + "Name: 15, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 PFD-286 2 5,552.04\n", + "1 QFP-254 2 361.30\n", + "2 YOT-530 4 3,766.92\n", + "========================================================================================================================\n", + "client_id 71984468\n", + "client_name IPARRAGUIRRE VILLEGAS NICOLAS EDILBERTO\n", + "phonenumber 935441620\n", + "credit 7,570.49\n", + "Name: 16, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 PQH-935 2 188.90\n", + "1 JJN-837 5 9,899.60\n", + "2 TZY-323 1 2,341.01\n", + "========================================================================================================================\n", + "client_id 29847168\n", + "client_name ALDAVE ZEVALLOS ROSARIO\n", + "phonenumber 6261108\n", + "credit 5,000.00\n", + "Name: 17, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + "Empty DataFrame\n", + "Columns: [product_id, qty, total]\n", + "Index: []\n", + "========================================================================================================================\n", + "client_id 79475585\n", + "client_name RETTO ARCA ANNIE MAGDA\n", + "phonenumber 941241092\n", + "credit 4,568.30\n", + "Name: 18, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 BWD-036 5 5,431.70\n", + "========================================================================================================================\n", + "client_id 91897732\n", + "client_name GAMARRA ALCOCER VIRGINIA\n", + "phonenumber 954025615\n", + "credit 348.72\n", + "Name: 19, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 TMN-884 2 621.30\n", + "1 XZR-640 5 11,952.90\n", + "2 WLL-607 1 1,525.04\n", + "3 PFD-286 2 5,552.04\n", + "========================================================================================================================\n", + "client_id 33397650\n", + "client_name RONDON EGUSQUIZA CARMELA VALENTINA\n", + "phonenumber 3911397\n", + "credit 2,430.88\n", + "Name: 20, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 IHG-413 3 953.10\n", + "1 VJI-529 6 6,616.02\n", + "========================================================================================================================\n", + "client_id 83236386\n", + "client_name RIVERO CORRALES JUAN FERNANDO\n", + "phonenumber 946513105\n", + "credit 4,516.64\n", + "Name: 21, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 MTF-868 2 1,943.18\n", + "1 OPT-996 2 2,734.96\n", + "2 OFS-384 1 805.22\n", + "========================================================================================================================\n", + "client_id 32821689\n", + "client_name ZAVALETA EPIQUEN CARMEN ZKENIA\n", + "phonenumber 955248211\n", + "credit 3,181.04\n", + "Name: 22, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 ONB-903 3 1,961.01\n", + "1 MTF-868 5 4,857.95\n", + "========================================================================================================================\n", + "client_id 45783712\n", + "client_name POZO CHUNG RAFAEL DEL\n", + "phonenumber 8252118\n", + "credit 1,219.48\n", + "Name: 23, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 YUQ-590 2 3,958.14\n", + "1 QFR-958 3 4,822.38\n", + "========================================================================================================================\n", + "client_id 48184351\n", + "client_name LOPEZ JAUREGUI ROLANDO\n", + "phonenumber 884716679\n", + "credit 13,091.21\n", + "Name: 24, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 KQA-580 2 5,815.84\n", + "1 TXM-139 1 1,092.95\n", + "========================================================================================================================\n", + "client_id 33713901\n", + "client_name VILLEGAS CASTRO SOFIA VIRGINIA\n", + "phonenumber 2339560\n", + "credit 7,617.22\n", + "Name: 25, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 UWA-476 2 2,382.78\n", + "========================================================================================================================\n", + "client_id 76388967\n", + "client_name GONZALES QUIO ISABEL\n", + "phonenumber 8094909\n", + "credit 10,000.00\n", + "Name: 26, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + "Empty DataFrame\n", + "Columns: [product_id, qty, total]\n", + "Index: []\n", + "========================================================================================================================\n", + "client_id 81114108\n", + "client_name ZAMBRANO SHIRAKAWA WILMER\n", + "phonenumber 5853087\n", + "credit 431.70\n", + "Name: 27, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 VRR-793 4 966.84\n", + "1 RBE-789 2 6,606.14\n", + "2 DFF-034 5 1,296.25\n", + "3 VCL-867 1 699.07\n", + "========================================================================================================================\n", + "client_id 57263719\n", + "client_name PRADO TORREALBA CARMEN JANET\n", + "phonenumber 988736554\n", + "credit 678.90\n", + "Name: 28, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 BWD-036 3 3,259.02\n", + "1 OTH-462 2 1,062.08\n", + "========================================================================================================================\n", + "client_id 79140840\n", + "client_name TORREALBA ARCA VICTORIA GLENDA\n", + "phonenumber 876488179\n", + "credit 4,354.41\n", + "Name: 29, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 DFF-034 3 777.75\n", + "1 HLR-109 1 439.47\n", + "2 OTH-462 1 531.04\n", + "3 TMN-884 5 1,553.25\n", + "4 JXD-139 4 2,344.08\n", + "========================================================================================================================\n", + "client_id 71378466\n", + "client_name MIYAKE CARO HENRRY EDGAR\n", + "phonenumber 921051207\n", + "credit 5,472.12\n", + "Name: 30, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 BIT-434 4 1,500.36\n", + "1 FVQ-662 2 2,121.36\n", + "2 OQI-373 1 906.16\n", + "========================================================================================================================\n", + "client_id 17913944\n", + "client_name PALOMARES SANTISTEBAN HENRRY\n", + "phonenumber 967944433\n", + "credit 3,166.74\n", + "Name: 31, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 IHG-413 4 1,270.80\n", + "1 DEN-125 1 562.46\n", + "========================================================================================================================\n", + "client_id 62566305\n", + "client_name ROMERO ALFARO MONICA JOHANA\n", + "phonenumber 8206363\n", + "credit 54.77\n", + "Name: 32, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 DIQ-718 4 1,563.20\n", + "1 GXF-122 5 5,550.80\n", + "2 AVM-258 1 2,831.23\n", + "========================================================================================================================\n", + "client_id 46462527\n", + "client_name LOYOLA MORI NICOLAS FERNANDO\n", + "phonenumber 5865695\n", + "credit 2,281.60\n", + "Name: 33, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 KCO-488 4 2,718.40\n", + "========================================================================================================================\n", + "client_id 79420973\n", + "client_name AURIS JOLAY DIANA\n", + "phonenumber 7073267\n", + "credit 1,669.52\n", + "Name: 34, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 GXF-122 3 3,330.48\n", + "========================================================================================================================\n", + "client_id 22777006\n", + "client_name ASMAD PINTO MARIA LORENA\n", + "phonenumber 939918070\n", + "credit 1,135.05\n", + "Name: 35, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 FCN-617 1 4,121.05\n", + "1 XLF-273 2 4,743.90\n", + "========================================================================================================================\n", + "client_id 43877279\n", + "client_name RARAZ SUCHERO ADOLFO\n", + "phonenumber 4105386\n", + "credit 2,729.16\n", + "Name: 36, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 SSD-176 4 2,270.84\n", + "========================================================================================================================\n", + "client_id 73535476\n", + "client_name AYALA SANCHEZ MARIA TERESA\n", + "phonenumber 892714088\n", + "credit 1,590.29\n", + "Name: 37, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 UWA-476 5 5,956.95\n", + "1 KJX-387 4 2,452.76\n", + "========================================================================================================================\n", + "client_id 26976877\n", + "client_name TORO CUBA DIALY DIANA\n", + "phonenumber 2748661\n", + "credit 3,297.23\n", + "Name: 38, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 VTV-269 4 3,417.92\n", + "1 JXD-139 2 1,172.04\n", + "2 XZG-521 3 2,112.81\n", + "========================================================================================================================\n", + "client_id 78078115\n", + "client_name TSUKAZAN AMEZQUITA DELIA\n", + "phonenumber 905818632\n", + "credit 3,913.79\n", + "Name: 39, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 DFF-034 2 518.50\n", + "1 SSD-176 1 567.71\n", + "========================================================================================================================\n", + "client_id 48467976\n", + "client_name BENITES SANCHEZ MARGOT DELICIA\n", + "phonenumber 4888316\n", + "credit 5,000.00\n", + "Name: 40, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + "Empty DataFrame\n", + "Columns: [product_id, qty, total]\n", + "Index: []\n", + "========================================================================================================================\n", + "client_id 41036366\n", + "client_name JUSTINO LOYOLA JENNY MAGDA\n", + "phonenumber 5939760\n", + "credit 5,000.00\n", + "Name: 41, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + "Empty DataFrame\n", + "Columns: [product_id, qty, total]\n", + "Index: []\n", + "========================================================================================================================\n", + "client_id 31611146\n", + "client_name LANDEO LARRIEGA MARTIN\n", + "phonenumber 8566657\n", + "credit 1,990.36\n", + "Name: 42, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 YOT-530 4 3,766.92\n", + "1 FVQ-662 4 4,242.72\n", + "========================================================================================================================\n", + "client_id 64394265\n", + "client_name SALAZAR GONZALES DAVID RAFAEL\n", + "phonenumber 938884629\n", + "credit 973.90\n", + "Name: 43, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 OFS-384 5 4,026.10\n", + "========================================================================================================================\n", + "client_id 50365593\n", + "client_name SUAREZ BRAVO MARIELLA TATIANA\n", + "phonenumber 965004473\n", + "credit 1,675.15\n", + "Name: 44, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 AFL-718 5 8,324.85\n", + "========================================================================================================================\n", + "client_id 95751208\n", + "client_name CORONEL ZEGARRA FIORELLA\n", + "phonenumber 925608637\n", + "credit 1,684.24\n", + "Name: 45, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 UOD-420 4 3,315.76\n", + "========================================================================================================================\n", + "client_id 79372768\n", + "client_name BERROCAL YALLICO ANNIE SOFIA\n", + "phonenumber 897157366\n", + "credit 5,515.86\n", + "Name: 46, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 GLC-370 4 2,208.96\n", + "1 SAM-013 1 2,275.18\n", + "========================================================================================================================\n", + "client_id 27912250\n", + "client_name CUBA CHUNG ISRAEL EDILBERTO\n", + "phonenumber 2489481\n", + "credit 3,271.63\n", + "Name: 47, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 ICX-503 1 1,221.02\n", + "1 LWG-915 4 4,405.88\n", + "2 LWG-915 1 1,101.47\n", + "========================================================================================================================\n", + "client_id 60574154\n", + "client_name LOZADA GONZALES JAIME\n", + "phonenumber 962838234\n", + "credit 4,239.12\n", + "Name: 48, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 BWD-036 2 2,172.68\n", + "1 III-576 6 6,465.90\n", + "2 KDA-627 5 7,122.30\n", + "========================================================================================================================\n", + "client_id 35565959\n", + "client_name VILCARA RODRIGUEZ ANNIE\n", + "phonenumber 7272527\n", + "credit 1,912.13\n", + "Name: 49, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 BZS-261 1 3,087.87\n", + "========================================================================================================================\n", + "client_id 80048864\n", + "client_name JUSTINO CASTILLO SANDRO CHRISTIAN\n", + "phonenumber 929077160\n", + "credit 475.25\n", + "Name: 50, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 RDT-761 5 4,524.75\n", + "========================================================================================================================\n", + "client_id 96258632\n", + "client_name FLORENCIO GARCIA WALTER\n", + "phonenumber 993338854\n", + "credit 873.98\n", + "Name: 51, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 CRU-009 2 5,311.56\n", + "1 QHC-492 2 3,814.46\n", + "========================================================================================================================\n", + "client_id 94080926\n", + "client_name SORIA CRUZ MADELEINE\n", + "phonenumber 6726720\n", + "credit 2,513.50\n", + "Name: 52, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 TXM-139 5 5,464.75\n", + "1 SPR-580 5 2,021.75\n", + "========================================================================================================================\n", + "client_id 42157219\n", + "client_name LUNA CUEVA RICHARD\n", + "phonenumber 6465719\n", + "credit 3,640.80\n", + "Name: 53, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 KCO-488 2 1,359.20\n", + "========================================================================================================================\n", + "client_id 86241107\n", + "client_name SANCHEZ EPIQUEN EDGAR MELVIN\n", + "phonenumber 3096849\n", + "credit 3,040.90\n", + "Name: 54, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 CIM-038 2 5,089.28\n", + "1 UXG-019 2 1,869.82\n", + "========================================================================================================================\n", + "client_id 26290971\n", + "client_name SANTISTEBAN AYALA CAROLA MARITZA\n", + "phonenumber 988835189\n", + "credit 4,070.69\n", + "Name: 55, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 PVZ-181 3 929.31\n", + "========================================================================================================================\n", + "client_id 22280452\n", + "client_name GONZALES MALDONADO ZKENIA ERIKA\n", + "phonenumber 5066321\n", + "credit 4,271.59\n", + "Name: 56, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 XSD-310 2 4,519.86\n", + "1 VRR-793 5 1,208.55\n", + "========================================================================================================================\n", + "client_id 90365520\n", + "client_name PALOMINO ADAMS SANDRO RONALD\n", + "phonenumber 964902408\n", + "credit 248.20\n", + "Name: 57, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 KWP-672 6 9,751.80\n", + "========================================================================================================================\n", + "client_id 40348917\n", + "client_name VEGA TSUKAZAN VALENTINA\n", + "phonenumber 962692699\n", + "credit 4,697.18\n", + "Name: 58, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 WZD-331 3 3,641.37\n", + "1 BMJ-772 1 936.32\n", + "2 VRR-793 3 725.13\n", + "========================================================================================================================\n", + "client_id 95161027\n", + "client_name FALCON POZO WALTER\n", + "phonenumber 907875771\n", + "credit 1,888.50\n", + "Name: 59, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 VJI-529 2 2,205.34\n", + "1 OQI-373 1 906.16\n", + "========================================================================================================================\n", + "client_id 77191257\n", + "client_name CORRALES ZUNIGA JENNY\n", + "phonenumber 6329003\n", + "credit 3,236.20\n", + "Name: 60, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 QVJ-982 5 6,763.80\n", + "========================================================================================================================\n", + "client_id 62324793\n", + "client_name GAVIDIA MORENO ISRAEL ROLANDO\n", + "phonenumber 979240911\n", + "credit 2,298.13\n", + "Name: 61, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 LDR-510 1 2,701.87\n", + "========================================================================================================================\n", + "client_id 16151792\n", + "client_name DURAND CASTRO FLOR MARTHA\n", + "phonenumber 8008929\n", + "credit 2,669.01\n", + "Name: 62, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 WZD-331 3 3,641.37\n", + "1 CNQ-172 1 3,689.62\n", + "========================================================================================================================\n", + "client_id 66409237\n", + "client_name CANO DELGADO WILLIAMS\n", + "phonenumber 969142116\n", + "credit 1,379.10\n", + "Name: 63, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 DFF-034 4 1,037.00\n", + "1 BRD-969 3 7,739.16\n", + "2 UXG-019 4 3,739.64\n", + "3 ICX-503 5 6,105.10\n", + "========================================================================================================================\n", + "client_id 63437380\n", + "client_name PINTO CABELLO SILVIA FELICITA\n", + "phonenumber 8343056\n", + "credit 1,410.27\n", + "Name: 64, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 III-576 5 5,388.25\n", + "1 AWB-345 4 3,201.48\n", + "========================================================================================================================\n", + "client_id 95015539\n", + "client_name CHANG SAONA RONALD\n", + "phonenumber 974180726\n", + "credit 6,572.86\n", + "Name: 65, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 CSZ-863 2 3,427.14\n", + "========================================================================================================================\n", + "client_id 25171011\n", + "client_name CRUZ JUGO SANDRO FAUSTO\n", + "phonenumber 982755508\n", + "credit 555.93\n", + "Name: 66, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 VCL-867 3 2,097.21\n", + "1 AWB-345 6 4,802.22\n", + "2 CIM-038 1 2,544.64\n", + "========================================================================================================================\n", + "client_id 90237332\n", + "client_name ESPINOZA CASTRO YDALI GIOVANA\n", + "phonenumber 8119710\n", + "credit 5,796.32\n", + "Name: 67, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 QFP-254 3 541.95\n", + "1 PVZ-181 5 1,548.85\n", + "2 OQI-373 1 906.16\n", + "3 TKM-141 3 1,206.72\n", + "========================================================================================================================\n", + "client_id 87800799\n", + "client_name QUIROGA SALAZAR JOHNNY ROBERTO\n", + "phonenumber 8105714\n", + "credit 1,396.36\n", + "Name: 68, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 KWP-672 2 3,250.60\n", + "1 VRR-793 2 483.42\n", + "2 WZD-331 2 2,427.58\n", + "3 ICX-503 2 2,442.04\n", + "========================================================================================================================\n", + "client_id 38637282\n", + "client_name TABORI CARBAJAL YDALI MAGDA\n", + "phonenumber 914898726\n", + "credit 9,194.78\n", + "Name: 69, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 OFS-384 1 805.22\n", + "========================================================================================================================\n", + "client_id 15561764\n", + "client_name VILLEGAS CASTRO ALONSO\n", + "phonenumber 4983446\n", + "credit 7,140.66\n", + "Name: 70, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 GBJ-693 2 628.40\n", + "1 JYQ-045 6 1,602.90\n", + "2 RAH-420 4 628.04\n", + "========================================================================================================================\n", + "client_id 45877001\n", + "client_name SORIA VILLA HENRRY\n", + "phonenumber 876812206\n", + "credit 3,904.25\n", + "Name: 71, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 GBJ-693 5 1,571.00\n", + "1 RDT-761 5 4,524.75\n", + "========================================================================================================================\n", + "client_id 87813843\n", + "client_name AYALA ACUNA RONY ALEX\n", + "phonenumber 967252992\n", + "credit 2,314.05\n", + "Name: 72, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 XSD-310 3 6,779.79\n", + "1 OQI-373 1 906.16\n", + "========================================================================================================================\n", + "client_id 78757121\n", + "client_name ASTETE SOLIS FANNY\n", + "phonenumber 881829766\n", + "credit 1,171.36\n", + "Name: 73, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 OQI-373 3 2,718.48\n", + "1 GXF-122 1 1,110.16\n", + "========================================================================================================================\n", + "client_id 53166028\n", + "client_name CANO CHUNG EMILIO NICOLAS\n", + "phonenumber 935212007\n", + "credit 2,852.91\n", + "Name: 74, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 QHC-492 1 1,907.23\n", + "1 ONB-903 3 1,961.01\n", + "2 TXM-139 3 3,278.85\n", + "========================================================================================================================\n", + "client_id 15210391\n", + "client_name QUIROGA CASANOVA BRUNO\n", + "phonenumber 912496602\n", + "credit 194.17\n", + "Name: 75, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 OTW-288 3 3,357.54\n", + "1 HFM-021 1 726.91\n", + "2 DON-719 2 721.38\n", + "========================================================================================================================\n", + "client_id 89429489\n", + "client_name SERRANO IPARRAGUIRRE VIRGINIA\n", + "phonenumber 926380835\n", + "credit 2,325.13\n", + "Name: 76, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 QUU-384 1 2,545.54\n", + "1 UXG-019 1 934.91\n", + "2 VCL-867 6 4,194.42\n", + "========================================================================================================================\n", + "client_id 43488351\n", + "client_name MINAYA CERNA LORENA FIORELLA\n", + "phonenumber 7039872\n", + "credit 5,795.45\n", + "Name: 77, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 XLF-273 5 11,859.75\n", + "1 DIQ-718 6 2,344.80\n", + "========================================================================================================================\n", + "client_id 73185299\n", + "client_name CORTES LANDA SURAMI\n", + "phonenumber 3032891\n", + "credit 2,503.63\n", + "Name: 78, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 OTH-462 3 1,593.12\n", + "1 QFP-254 5 903.25\n", + "========================================================================================================================\n", + "client_id 36380447\n", + "client_name RIVERO RETTO JESUS\n", + "phonenumber 963345715\n", + "credit 8,016.96\n", + "Name: 79, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 OWN-701 5 1,104.10\n", + "1 HLR-109 2 878.94\n", + "========================================================================================================================\n", + "client_id 97403853\n", + "client_name PISCOYA MALCA MARIA MONICA\n", + "phonenumber 906047403\n", + "credit 657.91\n", + "Name: 80, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 YJD-279 3 3,085.29\n", + "1 GBJ-693 4 1,256.80\n", + "========================================================================================================================\n", + "client_id 13245501\n", + "client_name ESCALANTE YINO EDWARD GONZALO\n", + "phonenumber 897778693\n", + "credit 486.92\n", + "Name: 81, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 AWB-345 1 800.37\n", + "1 ZWF-661 1 2,731.61\n", + "2 QIL-029 2 5,981.10\n", + "========================================================================================================================\n", + "client_id 89148118\n", + "client_name ZAMBRANO LEYVA ALVARO\n", + "phonenumber 987004291\n", + "credit 921.59\n", + "Name: 82, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 TKM-141 6 2,413.44\n", + "1 AFL-718 1 1,664.97\n", + "========================================================================================================================\n", + "client_id 93845419\n", + "client_name QUIO GAVIDIA DIALY FELICITA\n", + "phonenumber 5696816\n", + "credit 815.27\n", + "Name: 83, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 AWB-345 5 4,001.85\n", + "1 NSR-955 2 5,182.88\n", + "========================================================================================================================\n", + "client_id 19829266\n", + "client_name TOMASICHE MEJIA MELVIN\n", + "phonenumber 915529528\n", + "credit 2,136.48\n", + "Name: 84, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 TXM-139 3 3,278.85\n", + "1 RDT-761 3 2,714.85\n", + "2 UXG-019 2 1,869.82\n", + "========================================================================================================================\n", + "client_id 26233063\n", + "client_name TSUKAZAN AYALA MARINA MAGDA\n", + "phonenumber 937953132\n", + "credit 4,835.42\n", + "Name: 85, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 UWA-476 1 1,191.39\n", + "1 KSO-608 3 2,742.51\n", + "2 JFC-432 4 1,230.68\n", + "========================================================================================================================\n", + "client_id 78922174\n", + "client_name ALAMO MEZA ALVARO\n", + "phonenumber 5307494\n", + "credit 830.60\n", + "Name: 86, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 TKM-141 5 2,011.20\n", + "1 EJW-346 6 2,158.20\n", + "========================================================================================================================\n", + "client_id 42798099\n", + "client_name ZEGARRA MUNOZ SONIA GUIDA\n", + "phonenumber 874064223\n", + "credit 1,204.73\n", + "Name: 87, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 TMN-884 5 1,553.25\n", + "1 OQI-373 2 1,812.32\n", + "2 RDT-761 6 5,429.70\n", + "========================================================================================================================\n", + "client_id 79901434\n", + "client_name SALAZAR FLORENCIO SANDRO JOHNNY\n", + "phonenumber 910817217\n", + "credit 5,757.60\n", + "Name: 88, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 AHB-459 3 2,056.50\n", + "1 TXM-139 2 2,185.90\n", + "========================================================================================================================\n", + "client_id 50375303\n", + "client_name SANCHEZ HUAYANAY DIALY LUCERO\n", + "phonenumber 5956481\n", + "credit 1,483.88\n", + "Name: 89, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 JXD-139 6 3,516.12\n", + "========================================================================================================================\n", + "client_id 55552996\n", + "client_name SUCHERO PRECIADO MILAGROS ERICKA\n", + "phonenumber 971740977\n", + "credit 1,002.79\n", + "Name: 90, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 UXG-019 6 5,609.46\n", + "1 SJD-818 1 3,387.75\n", + "========================================================================================================================\n", + "client_id 45828535\n", + "client_name SEDANO MERCADO FIORELLA GLORIA\n", + "phonenumber 4957431\n", + "credit 960.28\n", + "Name: 91, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 XSD-310 4 9,039.72\n", + "========================================================================================================================\n", + "client_id 44229880\n", + "client_name PALOMARES BARRIOS EDWARD CESAR\n", + "phonenumber 887564400\n", + "credit 458.57\n", + "Name: 92, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 JXD-139 4 2,344.08\n", + "1 HLR-109 5 2,197.35\n", + "========================================================================================================================\n", + "client_id 59162728\n", + "client_name HUAYANAY CORTES GLENDA MARINA\n", + "phonenumber 960688828\n", + "credit 3,217.20\n", + "Name: 93, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 FEG-454 4 6,782.80\n", + "========================================================================================================================\n", + "client_id 88995291\n", + "client_name PEREZ TORRES MILAGROS REBECA\n", + "phonenumber 960731274\n", + "credit 6,206.29\n", + "Name: 94, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 MTF-868 3 2,914.77\n", + "1 HLR-109 2 878.94\n", + "========================================================================================================================\n", + "client_id 73914283\n", + "client_name CASANOVA CARBAJAL RICARDO ISRAEL\n", + "phonenumber 5786088\n", + "credit 7,039.44\n", + "Name: 95, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 OBI-353 1 2,960.56\n", + "========================================================================================================================\n", + "client_id 44679500\n", + "client_name CORREA ARCA HELI\n", + "phonenumber 3659359\n", + "credit 4,199.63\n", + "Name: 96, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 AWB-345 1 800.37\n", + "========================================================================================================================\n", + "client_id 59407188\n", + "client_name CANALES MOYA ALONSO JULIO\n", + "phonenumber 957111009\n", + "credit 3,003.89\n", + "Name: 97, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 BIT-434 6 2,250.54\n", + "1 OWN-701 1 220.82\n", + "2 RDT-761 5 4,524.75\n", + "========================================================================================================================\n", + "client_id 27635082\n", + "client_name CONTRERAS GUEVARA MARINA\n", + "phonenumber 984517554\n", + "credit 10,000.00\n", + "Name: 98, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + "Empty DataFrame\n", + "Columns: [product_id, qty, total]\n", + "Index: []\n", + "========================================================================================================================\n", + "client_id 54716824\n", + "client_name VALVERDE SEGURA MIGUEL JOSE\n", + "phonenumber 968948630\n", + "credit 7,925.25\n", + "Name: 99, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 SPR-580 3 1,213.05\n", + "1 UDR-957 1 861.70\n", + "========================================================================================================================\n", + "client_id 40112594\n", + "client_name CARO RARAZ CHRISTIAN RONAL\n", + "phonenumber 4538089\n", + "credit 272.26\n", + "Name: 100, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 KSO-608 6 5,485.02\n", + "1 FVQ-662 4 4,242.72\n", + "========================================================================================================================\n", + "client_id 37110873\n", + "client_name VERGEL HIJAR JESUS\n", + "phonenumber 8271950\n", + "credit 2,211.97\n", + "Name: 101, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 SSD-176 1 567.71\n", + "1 GXF-122 2 2,220.32\n", + "========================================================================================================================\n", + "client_id 83505958\n", + "client_name CONTRERAS MEZA ERIKA BLANCA\n", + "phonenumber 3913878\n", + "credit 8,649.24\n", + "Name: 102, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 EJW-346 3 1,079.10\n", + "1 MQR-442 1 271.66\n", + "========================================================================================================================\n", + "client_id 85871751\n", + "client_name AYALA LAURA JANET\n", + "phonenumber 933420698\n", + "credit 6,986.40\n", + "Name: 103, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 MYC-756 2 3,013.60\n", + "========================================================================================================================\n", + "client_id 11602775\n", + "client_name HIJAR ARCA ADOLFO\n", + "phonenumber 904695641\n", + "credit 4,060.24\n", + "Name: 104, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 JJN-837 1 1,979.92\n", + "1 JJN-837 2 3,959.84\n", + "========================================================================================================================\n", + "client_id 86402303\n", + "client_name RUIZ RUIZ OFELIA DELIA\n", + "phonenumber 972026581\n", + "credit 201.58\n", + "Name: 105, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 OQI-373 3 2,718.48\n", + "1 OQI-373 3 2,718.48\n", + "2 HFM-021 6 4,361.46\n", + "========================================================================================================================\n", + "client_id 23928045\n", + "client_name ARCA VILCA RONALD\n", + "phonenumber 5399501\n", + "credit 5,164.56\n", + "Name: 106, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 TMN-884 2 621.30\n", + "1 TKM-141 5 2,011.20\n", + "2 LWG-915 2 2,202.94\n", + "========================================================================================================================\n", + "client_id 12663268\n", + "client_name BARRERA FLORES ENRIQUE\n", + "phonenumber 891999690\n", + "credit 2,561.62\n", + "Name: 107, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 AHB-459 3 2,056.50\n", + "1 YYU-726 4 3,071.28\n", + "2 RAH-420 3 471.03\n", + "3 BMJ-772 1 936.32\n", + "4 QFP-254 5 903.25\n", + "========================================================================================================================\n", + "client_id 42928709\n", + "client_name HERNANDEZ MALCA VIRGINIA\n", + "phonenumber 6822015\n", + "credit 315.95\n", + "Name: 108, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 NSM-283 5 4,684.05\n", + "========================================================================================================================\n", + "client_id 85949265\n", + "client_name LEYVA GONZALES CINTHIA\n", + "phonenumber 947841946\n", + "credit 3,602.63\n", + "Name: 109, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 JFC-432 4 1,230.68\n", + "1 YUQ-590 2 3,958.14\n", + "2 VRR-793 5 1,208.55\n", + "========================================================================================================================\n", + "client_id 17972674\n", + "client_name PISCOYA PORTUGAL WALDEMAR GUSTAVO\n", + "phonenumber 7133680\n", + "credit 1,705.88\n", + "Name: 110, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 ZWF-661 1 2,731.61\n", + "1 UTN-601 1 562.51\n", + "========================================================================================================================\n", + "client_id 38913831\n", + "client_name FUENTES TSUKAZAN PATRICIA OFELIA\n", + "phonenumber 950215881\n", + "credit 5,037.58\n", + "Name: 111, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 YZD-580 1 1,582.29\n", + "1 JFC-432 3 923.01\n", + "2 FLW-631 3 2,457.12\n", + "========================================================================================================================\n", + "client_id 36008913\n", + "client_name CASTILLO ZAMORA VICTOR NESTOR\n", + "phonenumber 985923364\n", + "credit 5,000.00\n", + "Name: 112, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + "Empty DataFrame\n", + "Columns: [product_id, qty, total]\n", + "Index: []\n", + "========================================================================================================================\n", + "client_id 49087435\n", + "client_name GALLO MARTINEZ VICTOR GUILLERMO\n", + "phonenumber 3714856\n", + "credit 1,143.69\n", + "Name: 113, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 VDD-853 2 2,191.34\n", + "1 AFL-718 1 1,664.97\n", + "========================================================================================================================\n", + "client_id 58187172\n", + "client_name SUAREZ ZIMIC MOISES\n", + "phonenumber 882248669\n", + "credit 3,393.52\n", + "Name: 114, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 KBY-991 6 6,606.48\n", + "========================================================================================================================\n", + "client_id 69324480\n", + "client_name FLORES IPARRAGUIRRE HENRRY RICARDO\n", + "phonenumber 993711730\n", + "credit 6,019.71\n", + "Name: 115, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 UOD-420 3 2,486.82\n", + "1 DIQ-718 1 390.80\n", + "2 VJI-529 1 1,102.67\n", + "========================================================================================================================\n", + "client_id 32565207\n", + "client_name RIVERA ZARATE MARINA\n", + "phonenumber 2654996\n", + "credit 1,260.36\n", + "Name: 116, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 UXG-019 4 3,739.64\n", + "========================================================================================================================\n", + "client_id 71463316\n", + "client_name PRADO CALIXTO KARIN\n", + "phonenumber 998998403\n", + "credit 1,943.93\n", + "Name: 117, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 KCO-488 5 3,398.00\n", + "1 UWA-476 3 3,574.17\n", + "2 QFP-254 6 1,083.90\n", + "========================================================================================================================\n", + "client_id 86828079\n", + "client_name PRECIADO ADAMS ERIKA DELIA\n", + "phonenumber 884791387\n", + "credit 9,185.02\n", + "Name: 118, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 MQR-442 3 814.98\n", + "========================================================================================================================\n", + "client_id 29337157\n", + "client_name VIZCARDO YEP GUIDA YOLANDA\n", + "phonenumber 908273495\n", + "credit 2,237.20\n", + "Name: 119, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 HFM-021 4 2,907.64\n", + "1 WZD-331 4 4,855.16\n", + "========================================================================================================================\n", + "client_id 32904023\n", + "client_name PRADO FORZANI LOURDES\n", + "phonenumber 4053489\n", + "credit 2,437.83\n", + "Name: 120, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 KJX-387 3 1,839.57\n", + "1 QFP-254 4 722.60\n", + "========================================================================================================================\n", + "client_id 28390487\n", + "client_name IPARRAGUIRRE PAREDES RAUL\n", + "phonenumber 967488454\n", + "credit 3,895.52\n", + "Name: 121, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 GLC-370 2 1,104.48\n", + "========================================================================================================================\n", + "client_id 98589725\n", + "client_name FORZANI ANTEZANO OSCAR JOSE\n", + "phonenumber 894689292\n", + "credit 9,758.29\n", + "Name: 122, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 VRR-793 1 241.71\n", + "========================================================================================================================\n", + "client_id 77484838\n", + "client_name EPIQUEN ALAMO NANCY\n", + "phonenumber 941780448\n", + "credit 355.85\n", + "Name: 123, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 UWA-476 1 1,191.39\n", + "1 BTO-226 4 3,452.76\n", + "========================================================================================================================\n", + "client_id 88956889\n", + "client_name CHUMPITAZ CARBAJAL MARITZA\n", + "phonenumber 935335997\n", + "credit 1,369.75\n", + "Name: 124, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 TMN-884 1 310.65\n", + "1 YUQ-590 2 3,958.14\n", + "2 HFM-021 6 4,361.46\n", + "========================================================================================================================\n", + "client_id 89863424\n", + "client_name SANTISTEBAN BRAVO EDGARD\n", + "phonenumber 990095135\n", + "credit 2,046.93\n", + "Name: 125, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 FVB-607 1 2,953.07\n", + "========================================================================================================================\n", + "client_id 99842319\n", + "client_name MARTINEZ MARTINEZ CARMELA\n", + "phonenumber 5042430\n", + "credit 1,804.08\n", + "Name: 126, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 DUG-251 2 3,195.92\n", + "========================================================================================================================\n", + "client_id 98140264\n", + "client_name ALAMO ZEGARRA ISRAEL GUSTAVO\n", + "phonenumber 990418360\n", + "credit 6,901.78\n", + "Name: 127, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 DFF-034 2 518.50\n", + "1 BRD-969 1 2,579.72\n", + "========================================================================================================================\n", + "client_id 69639726\n", + "client_name ROJAS PATINO GONZALO JAIR\n", + "phonenumber 930532818\n", + "credit 536.87\n", + "Name: 128, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 OPT-996 3 4,102.44\n", + "1 DON-719 1 360.69\n", + "========================================================================================================================\n", + "client_id 93160528\n", + "client_name SANTISTEBAN MARTEL MARTIN LUIS\n", + "phonenumber 945101047\n", + "credit 1,036.26\n", + "Name: 129, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 YYU-726 1 767.82\n", + "1 DUG-251 2 3,195.92\n", + "========================================================================================================================\n", + "client_id 24995742\n", + "client_name MEREL TAVERA WALTER\n", + "phonenumber 8695140\n", + "credit 113.19\n", + "Name: 130, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 KCO-488 4 2,718.40\n", + "1 DON-719 3 1,082.07\n", + "2 BWD-036 1 1,086.34\n", + "========================================================================================================================\n", + "client_id 43043986\n", + "client_name LOZADA VALVERDE MOISES HENRRY\n", + "phonenumber 8816113\n", + "credit 2,979.35\n", + "Name: 131, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 QFP-254 5 903.25\n", + "1 SSD-176 5 2,838.55\n", + "2 TXM-139 3 3,278.85\n", + "========================================================================================================================\n", + "client_id 52097922\n", + "client_name CUBA DURAND YVONNE\n", + "phonenumber 3509438\n", + "credit 616.26\n", + "Name: 132, dtype: object\n", + "------------------------------------------------------------------------------------------------------------------------\n", + " product_id qty total\n", + "0 OWN-701 2 441.64\n", + "1 UTN-601 2 1,125.02\n", + "2 XZG-521 4 2,817.08\n" + ] + } + ], + "source": [ + "# reporte\n", + "\n", + "# # This creates a report with different order for clients (as they appear in pedidos) \n", + "# for cid, df in pedidos.groupby('client_id', sort=False):\n", + "# print('========================================================================================================================')\n", + "# print(clientes.loc[[cid]])\n", + "# print('------------------------------------------------------------------------------------------------------------------------')\n", + "# print(df.loc[df['served'], ['product_id', 'client_id', 'qty']])\n", + "\n", + "for i, client in clientes.reset_index().iterrows():\n", + " print('========================================================================================================================')\n", + " print(client)\n", + " print('------------------------------------------------------------------------------------------------------------------------')\n", + " mask = (pedidos['client_id'] == client['client_id']) & (pedidos['served'])\n", + " t = pedidos.loc[mask, ['product_id', 'qty']]\n", + " t = t.merge(productos, how='left', on='product_id')\n", + " t['total'] = t['qty'] * t['price']\n", + " print(t[['product_id', 'qty', 'total']])" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10000.0" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "2_979.35 + 903.25 + 2_838.55 + 3_278.85" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10864.4" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "0 + 3843.75 + 903.25 + 2838.55 + 3278.85 " + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.11.5" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} |
