diff --git a/data_exploration/aum_analysis.ipynb b/data_exploration/aum_analysis.ipynb new file mode 100644 index 0000000..d7969a9 --- /dev/null +++ b/data_exploration/aum_analysis.ipynb @@ -0,0 +1,268 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# AUM Analysis\n", + "\n", + "This notebook sums the **Value - AUM €** by **Product - Asset Type** and by **Product - Fund** from the AUM sample data." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Collecting openpyxl\n", + " Downloading openpyxl-3.1.5-py2.py3-none-any.whl.metadata (2.5 kB)\n", + "Collecting et-xmlfile (from openpyxl)\n", + " Downloading et_xmlfile-2.0.0-py3-none-any.whl.metadata (2.7 kB)\n", + "Downloading openpyxl-3.1.5-py2.py3-none-any.whl (250 kB)\n", + "Downloading et_xmlfile-2.0.0-py3-none-any.whl (18 kB)\n", + "Installing collected packages: et-xmlfile, openpyxl\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2/2\u001b[0m [openpyxl]1/2\u001b[0m [openpyxl]\n", + "\u001b[1A\u001b[2KSuccessfully installed et-xmlfile-2.0.0 openpyxl-3.1.5\n" + ] + } + ], + "source": [ + "import pandas as pd\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "!pip install openpyxl\n", + "import os\n", + "import s3fs\n", + "import seaborn as sns\n", + "import plotly.express as px" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "fs = s3fs.S3FileSystem(\n", + " client_kwargs={'endpoint_url': 'https://'+'minio-simple.lab.groupe-genes.fr'},\n", + " key = os.environ[\"AWS_ACCESS_KEY_ID\"], \n", + " secret = os.environ[\"AWS_SECRET_ACCESS_KEY\"], \n", + " token = os.environ[\"AWS_SESSION_TOKEN\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_8794/3768862044.py:5: DtypeWarning: Columns (0,1,2,3) have mixed types. Specify dtype option on import or set low_memory=False.\n", + " stocks = pd.read_csv(f, sep=\";\")\n" + ] + } + ], + "source": [ + "#with fs.open('projet-bdc-data//carmignac/Flows ENSAE V2 -20251105.csv', 'rb') as f:\n", + " #flows = pd.read_csv(f, sep=\";\")\n", + "\n", + "with fs.open('projet-bdc-data//carmignac/AUM ENSAE V2 -20251105.csv', 'rb') as f:\n", + " stocks = pd.read_csv(f, sep=\";\")\n", + "\n", + "#with fs.open('projet-bdc-data/carmignac/Monthly AUM and NAV since 2010.xlsx', 'rb') as f:#\n", + " #nav_raw = pd.read_excel(f, header=None, engine=\"openpyxl\")\n", + "\n", + "#nav = nav_raw[0].str.split(\",\", expand=True)\n", + "#nav.columns = nav.iloc[0]\n", + "#nav = nav[1:].reset_index(drop=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Date conversion done.\n" + ] + } + ], + "source": [ + "stocks[\"Centralisation Date\"] = pd.to_datetime(stocks[\"Centralisation Date\"], errors=\"coerce\")\n", + "#flows[\"Centralisation Date\"] = pd.to_datetime(flows[\"Centralisation Date\"], errors=\"coerce\")\n", + "#nav[\"NavDate\"] = pd.to_datetime(nav[\"NavDate\"], format=\"%d/%m/%Y\", errors=\"coerce\")\n", + "\n", + "print(\"Date conversion done.\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Sum of AUM by Product - Asset Type" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "AUM (€) by Product - Asset Type:\n", + "Product - Asset Type\n", + "Diversified 2.249487e+12\n", + "Fixed Income 1.901982e+12\n", + "Equity 9.811712e+11\n", + "Alternative 1.208047e+11\n", + "NaN 1.786480e+10\n", + "Private Assets 2.205183e+09\n" + ] + }, + { + "data": { + "text/html": [ + "
| \n", + " | Product - Asset Type | \n", + "Total AUM (€) | \n", + "
|---|---|---|
| 0 | \n", + "Diversified | \n", + "2.249487e+12 | \n", + "
| 1 | \n", + "Fixed Income | \n", + "1.901982e+12 | \n", + "
| 2 | \n", + "Equity | \n", + "9.811712e+11 | \n", + "
| 3 | \n", + "Alternative | \n", + "1.208047e+11 | \n", + "
| 4 | \n", + "NaN | \n", + "1.786480e+10 | \n", + "
| 5 | \n", + "Private Assets | \n", + "2.205183e+09 | \n", + "