diff --git a/notebooks/experimental/cloud_price_analysis_azure.ipynb b/notebooks/experimental/cloud_price_analysis_azure.ipynb
new file mode 100644
index 0000000..eecb291
--- /dev/null
+++ b/notebooks/experimental/cloud_price_analysis_azure.ipynb
@@ -0,0 +1,2542 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "2c9f7b05",
+ "metadata": {},
+ "source": [
+ "### Analysis of Azure Pricing details \n",
+ "\n",
+ "This notebook will analyze service name = \"Virtual Machines\"\n",
+ "source JSON file https://prices.azure.com/api/retail/prices?api-version=2021-10-01-preview&meterRegion=%E2%80%99primary%E2%80%99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "2c2a399d",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:13.594615Z",
+ "start_time": "2022-03-30T14:21:12.072308Z"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "import pandas as pd\n",
+ "import requests"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0dbffa43",
+ "metadata": {},
+ "source": [
+ "#### Access the API end point for Vitual Machine and store JSON file at location ../data/raw/"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "414964d3",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:14.454430Z",
+ "start_time": "2022-03-30T14:21:13.599343Z"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "params = {\"filter\": \"serviceName eq Virtual Machines\"}\n",
+ "r = requests.get(\"https://prices.azure.com/api/retail/prices\", params=params)\n",
+ "with open(\"../../data/raw/azure_vm.json\", \"w\") as fd:\n",
+ " fd.write(r.text)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "c5afe6ed",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:14.650696Z",
+ "start_time": "2022-03-30T14:21:14.465487Z"
+ }
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " BillingCurrency | \n",
+ " CustomerEntityId | \n",
+ " CustomerEntityType | \n",
+ " Items | \n",
+ " NextPageLink | \n",
+ " Count | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " USD | \n",
+ " Default | \n",
+ " Retail | \n",
+ " {'currencyCode': 'USD', 'tierMinimumUnits': 0.... | \n",
+ " https://prices.azure.com:443/api/retail/prices... | \n",
+ " 100 | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " USD | \n",
+ " Default | \n",
+ " Retail | \n",
+ " {'currencyCode': 'USD', 'tierMinimumUnits': 0.... | \n",
+ " https://prices.azure.com:443/api/retail/prices... | \n",
+ " 100 | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " USD | \n",
+ " Default | \n",
+ " Retail | \n",
+ " {'currencyCode': 'USD', 'tierMinimumUnits': 0.... | \n",
+ " https://prices.azure.com:443/api/retail/prices... | \n",
+ " 100 | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " USD | \n",
+ " Default | \n",
+ " Retail | \n",
+ " {'currencyCode': 'USD', 'tierMinimumUnits': 0.... | \n",
+ " https://prices.azure.com:443/api/retail/prices... | \n",
+ " 100 | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " USD | \n",
+ " Default | \n",
+ " Retail | \n",
+ " {'currencyCode': 'USD', 'tierMinimumUnits': 0.... | \n",
+ " https://prices.azure.com:443/api/retail/prices... | \n",
+ " 100 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " BillingCurrency CustomerEntityId CustomerEntityType \\\n",
+ "0 USD Default Retail \n",
+ "1 USD Default Retail \n",
+ "2 USD Default Retail \n",
+ "3 USD Default Retail \n",
+ "4 USD Default Retail \n",
+ "\n",
+ " Items \\\n",
+ "0 {'currencyCode': 'USD', 'tierMinimumUnits': 0.... \n",
+ "1 {'currencyCode': 'USD', 'tierMinimumUnits': 0.... \n",
+ "2 {'currencyCode': 'USD', 'tierMinimumUnits': 0.... \n",
+ "3 {'currencyCode': 'USD', 'tierMinimumUnits': 0.... \n",
+ "4 {'currencyCode': 'USD', 'tierMinimumUnits': 0.... \n",
+ "\n",
+ " NextPageLink Count \n",
+ "0 https://prices.azure.com:443/api/retail/prices... 100 \n",
+ "1 https://prices.azure.com:443/api/retail/prices... 100 \n",
+ "2 https://prices.azure.com:443/api/retail/prices... 100 \n",
+ "3 https://prices.azure.com:443/api/retail/prices... 100 \n",
+ "4 https://prices.azure.com:443/api/retail/prices... 100 "
+ ]
+ },
+ "execution_count": 3,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df = pd.read_json(\"../../data/raw/azure_vm.json\")\n",
+ "df.head()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0a904b57",
+ "metadata": {},
+ "source": [
+ "#### Understand shape of data"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "dc78fb08",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:14.808222Z",
+ "start_time": "2022-03-30T14:21:14.674502Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Shape of the data\n",
+ "\n",
+ " (100, 6)\n",
+ "\n",
+ "\n",
+ "\n",
+ "Is null?\n",
+ "\n",
+ " BillingCurrency 0\n",
+ "CustomerEntityId 0\n",
+ "CustomerEntityType 0\n",
+ "Items 0\n",
+ "NextPageLink 0\n",
+ "Count 0\n",
+ "dtype: int64\n",
+ "\n",
+ "\n",
+ "\n",
+ "Columnwise Datatype\n",
+ "\n",
+ " BillingCurrency object\n",
+ "CustomerEntityId object\n",
+ "CustomerEntityType object\n",
+ "Items object\n",
+ "NextPageLink object\n",
+ "Count int64\n",
+ "dtype: object\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Count | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " count | \n",
+ " 100.0 | \n",
+ "
\n",
+ " \n",
+ " mean | \n",
+ " 100.0 | \n",
+ "
\n",
+ " \n",
+ " std | \n",
+ " 0.0 | \n",
+ "
\n",
+ " \n",
+ " min | \n",
+ " 100.0 | \n",
+ "
\n",
+ " \n",
+ " 25% | \n",
+ " 100.0 | \n",
+ "
\n",
+ " \n",
+ " 50% | \n",
+ " 100.0 | \n",
+ "
\n",
+ " \n",
+ " 75% | \n",
+ " 100.0 | \n",
+ "
\n",
+ " \n",
+ " max | \n",
+ " 100.0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " Count\n",
+ "count 100.0\n",
+ "mean 100.0\n",
+ "std 0.0\n",
+ "min 100.0\n",
+ "25% 100.0\n",
+ "50% 100.0\n",
+ "75% 100.0\n",
+ "max 100.0"
+ ]
+ },
+ "execution_count": 4,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "print(\"Shape of the data\\n\\n\", df.shape)\n",
+ "print(\"\\n\\n\")\n",
+ "print(\"Is null?\\n\\n\", df.isnull().sum())\n",
+ "print(\"\\n\\n\")\n",
+ "print(\"Columnwise Datatype\\n\\n\", df.dtypes)\n",
+ "df.describe()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "247a537d",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-22T05:57:27.176179Z",
+ "start_time": "2022-03-22T05:57:27.170815Z"
+ }
+ },
+ "source": [
+ "#### Split data into multiple components, create series out of dataframes, List \"Items\" is carrying actual data items"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "aa0c94f6",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:16.185057Z",
+ "start_time": "2022-03-30T14:21:14.814013Z"
+ }
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "0 {'currencyCode': 'USD', 'tierMinimumUnits': 0....\n",
+ "1 {'currencyCode': 'USD', 'tierMinimumUnits': 0....\n",
+ "2 {'currencyCode': 'USD', 'tierMinimumUnits': 0....\n",
+ "3 {'currencyCode': 'USD', 'tierMinimumUnits': 0....\n",
+ "4 {'currencyCode': 'USD', 'tierMinimumUnits': 0....\n",
+ " ... \n",
+ "95 {'currencyCode': 'USD', 'tierMinimumUnits': 0....\n",
+ "96 {'currencyCode': 'USD', 'tierMinimumUnits': 0....\n",
+ "97 {'currencyCode': 'USD', 'tierMinimumUnits': 0....\n",
+ "98 {'currencyCode': 'USD', 'tierMinimumUnits': 0....\n",
+ "99 {'currencyCode': 'USD', 'tierMinimumUnits': 0....\n",
+ "Name: Items, Length: 100, dtype: object"
+ ]
+ },
+ "execution_count": 5,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_items = df[\"Items\"]\n",
+ "df_items = df_items.fillna(\"NA\")\n",
+ "df_items"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "68801327",
+ "metadata": {},
+ "source": [
+ "#### Some times JSON file is missing reservationTerm or sometimes carry the values are 1 Year, 3 Years or onDemand\n",
+ "Below piece of code will determine if reservationTime key exists if not insert key with default value as onDemand"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "565627e5",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:18.103506Z",
+ "start_time": "2022-03-30T14:21:16.193778Z"
+ },
+ "code_folding": []
+ },
+ "outputs": [],
+ "source": [
+ "df_items_2 = pd.DataFrame()\n",
+ "\n",
+ "for data in df_items:\n",
+ " df_dictionary = pd.DataFrame([data])\n",
+ " if \"reservationTerm\" in data:\n",
+ " df_items_2 = pd.concat([df_items_2, df_dictionary], ignore_index=True)\n",
+ " else:\n",
+ " data[\"reservationTerm\"] = \"OnDemand\"\n",
+ " df_items_2 = pd.concat([df_items_2, df_dictionary], ignore_index=True)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "2c313b91",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:18.320177Z",
+ "start_time": "2022-03-30T14:21:18.111715Z"
+ }
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " currencyCode | \n",
+ " tierMinimumUnits | \n",
+ " retailPrice | \n",
+ " unitPrice | \n",
+ " armRegionName | \n",
+ " location | \n",
+ " effectiveStartDate | \n",
+ " effectiveEndDate | \n",
+ " meterId | \n",
+ " meterName | \n",
+ " ... | \n",
+ " productName | \n",
+ " skuName | \n",
+ " serviceName | \n",
+ " serviceId | \n",
+ " serviceFamily | \n",
+ " unitOfMeasure | \n",
+ " type | \n",
+ " isPrimaryMeterRegion | \n",
+ " armSkuName | \n",
+ " reservationTerm | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.262752 | \n",
+ " 0.262752 | \n",
+ " southindia | \n",
+ " IN South | \n",
+ " 2022-03-01T00:00:00Z | \n",
+ " 2022-03-31T23:59:00Z | \n",
+ " 000009d0-057f-5f2b-b7e9-9e26add324a8 | \n",
+ " D14/DS14 Spot | \n",
+ " ... | \n",
+ " Virtual Machines D Series Windows | \n",
+ " D14 Spot | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " DevTestConsumption | \n",
+ " True | \n",
+ " Standard_D14 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.542506 | \n",
+ " 0.542506 | \n",
+ " southindia | \n",
+ " IN South | \n",
+ " 2022-03-01T00:00:00Z | \n",
+ " 2022-03-31T23:59:00Z | \n",
+ " 000009d0-057f-5f2b-b7e9-9e26add324a8 | \n",
+ " D14/DS14 Spot | \n",
+ " ... | \n",
+ " Virtual Machines D Series Windows | \n",
+ " D14 Spot | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " True | \n",
+ " Standard_D14 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.865075 | \n",
+ " 0.865075 | \n",
+ " eastasia | \n",
+ " AP East | \n",
+ " 2022-03-01T00:00:00Z | \n",
+ " 2022-03-31T23:59:00Z | \n",
+ " 00014e7d-fff9-54dd-962e-4e992887ad3c | \n",
+ " D64s v5 Spot | \n",
+ " ... | \n",
+ " Virtual Machines Dsv5 Series Windows | \n",
+ " Standard_D64s_v5 Spot | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " DevTestConsumption | \n",
+ " True | \n",
+ " Standard_D64s_v5 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 1.468006 | \n",
+ " 1.468006 | \n",
+ " eastasia | \n",
+ " AP East | \n",
+ " 2022-03-01T00:00:00Z | \n",
+ " 2022-03-31T23:59:00Z | \n",
+ " 00014e7d-fff9-54dd-962e-4e992887ad3c | \n",
+ " D64s v5 Spot | \n",
+ " ... | \n",
+ " Virtual Machines Dsv5 Series Windows | \n",
+ " Standard_D64s_v5 Spot | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " True | \n",
+ " Standard_D64s_v5 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 10.560000 | \n",
+ " 10.560000 | \n",
+ " uksouth | \n",
+ " UK South | \n",
+ " 2018-11-01T00:00:00Z | \n",
+ " NA | \n",
+ " 0001d427-82df-4d83-8ab2-b60768527e08 | \n",
+ " E10 Disks | \n",
+ " ... | \n",
+ " Standard SSD Managed Disks | \n",
+ " E10 LRS | \n",
+ " Storage | \n",
+ " DZH317F1HKN0 | \n",
+ " Storage | \n",
+ " 1/Month | \n",
+ " Consumption | \n",
+ " True | \n",
+ " | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 95 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.212000 | \n",
+ " 0.212000 | \n",
+ " westcentralus | \n",
+ " US West Central | \n",
+ " 2021-11-01T00:00:00Z | \n",
+ " NA | \n",
+ " 00172462-4604-5a25-b1d4-f057577d68e0 | \n",
+ " E4ds v5 Low Priority | \n",
+ " ... | \n",
+ " Virtual Machines Edsv5 Series Windows | \n",
+ " E4ds v5 Low Priority | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " True | \n",
+ " Standard_E4ds_v5 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 96 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.069100 | \n",
+ " 0.069100 | \n",
+ " westcentralus | \n",
+ " US West Central | \n",
+ " 2021-11-01T00:00:00Z | \n",
+ " NA | \n",
+ " 00172462-4604-5a25-b1d4-f057577d68e0 | \n",
+ " E4-2ds v5 Low Priority | \n",
+ " ... | \n",
+ " Virtual Machines Edsv5 Series Windows | \n",
+ " E4-2ds v5 Low Priority | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " DevTestConsumption | \n",
+ " False | \n",
+ " Standard_E4-2ds_v5 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 97 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.212000 | \n",
+ " 0.212000 | \n",
+ " westcentralus | \n",
+ " US West Central | \n",
+ " 2021-11-01T00:00:00Z | \n",
+ " NA | \n",
+ " 00172462-4604-5a25-b1d4-f057577d68e0 | \n",
+ " E4-2ds v5 Low Priority | \n",
+ " ... | \n",
+ " Virtual Machines Edsv5 Series Windows | \n",
+ " E4-2ds v5 Low Priority | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " False | \n",
+ " Standard_E4-2ds_v5 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 98 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.181440 | \n",
+ " 0.181440 | \n",
+ " southindia | \n",
+ " IN South | \n",
+ " 2022-03-01T00:00:00Z | \n",
+ " 2022-03-31T23:59:00Z | \n",
+ " 001752ab-2e87-599e-8fac-f1ada637ca61 | \n",
+ " D5 v2/DS5 v2 Spot | \n",
+ " ... | \n",
+ " Virtual Machines Dv2 Series | \n",
+ " D5 v2 Spot | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " True | \n",
+ " Standard_D5_v2 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 99 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.456000 | \n",
+ " 0.456000 | \n",
+ " canadacentral | \n",
+ " CA Central | \n",
+ " 2021-10-01T00:00:00Z | \n",
+ " NA | \n",
+ " 001790af-f893-596a-b4f9-7b0837df43e3 | \n",
+ " DS13 Low Priority | \n",
+ " ... | \n",
+ " Virtual Machines DS Series Windows | \n",
+ " DS13 Low Priority | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " False | \n",
+ " Standard_DS13 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
100 rows × 22 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " currencyCode tierMinimumUnits retailPrice unitPrice armRegionName \\\n",
+ "0 USD 0.0 0.262752 0.262752 southindia \n",
+ "1 USD 0.0 0.542506 0.542506 southindia \n",
+ "2 USD 0.0 0.865075 0.865075 eastasia \n",
+ "3 USD 0.0 1.468006 1.468006 eastasia \n",
+ "4 USD 0.0 10.560000 10.560000 uksouth \n",
+ ".. ... ... ... ... ... \n",
+ "95 USD 0.0 0.212000 0.212000 westcentralus \n",
+ "96 USD 0.0 0.069100 0.069100 westcentralus \n",
+ "97 USD 0.0 0.212000 0.212000 westcentralus \n",
+ "98 USD 0.0 0.181440 0.181440 southindia \n",
+ "99 USD 0.0 0.456000 0.456000 canadacentral \n",
+ "\n",
+ " location effectiveStartDate effectiveEndDate \\\n",
+ "0 IN South 2022-03-01T00:00:00Z 2022-03-31T23:59:00Z \n",
+ "1 IN South 2022-03-01T00:00:00Z 2022-03-31T23:59:00Z \n",
+ "2 AP East 2022-03-01T00:00:00Z 2022-03-31T23:59:00Z \n",
+ "3 AP East 2022-03-01T00:00:00Z 2022-03-31T23:59:00Z \n",
+ "4 UK South 2018-11-01T00:00:00Z NA \n",
+ ".. ... ... ... \n",
+ "95 US West Central 2021-11-01T00:00:00Z NA \n",
+ "96 US West Central 2021-11-01T00:00:00Z NA \n",
+ "97 US West Central 2021-11-01T00:00:00Z NA \n",
+ "98 IN South 2022-03-01T00:00:00Z 2022-03-31T23:59:00Z \n",
+ "99 CA Central 2021-10-01T00:00:00Z NA \n",
+ "\n",
+ " meterId meterName ... \\\n",
+ "0 000009d0-057f-5f2b-b7e9-9e26add324a8 D14/DS14 Spot ... \n",
+ "1 000009d0-057f-5f2b-b7e9-9e26add324a8 D14/DS14 Spot ... \n",
+ "2 00014e7d-fff9-54dd-962e-4e992887ad3c D64s v5 Spot ... \n",
+ "3 00014e7d-fff9-54dd-962e-4e992887ad3c D64s v5 Spot ... \n",
+ "4 0001d427-82df-4d83-8ab2-b60768527e08 E10 Disks ... \n",
+ ".. ... ... ... \n",
+ "95 00172462-4604-5a25-b1d4-f057577d68e0 E4ds v5 Low Priority ... \n",
+ "96 00172462-4604-5a25-b1d4-f057577d68e0 E4-2ds v5 Low Priority ... \n",
+ "97 00172462-4604-5a25-b1d4-f057577d68e0 E4-2ds v5 Low Priority ... \n",
+ "98 001752ab-2e87-599e-8fac-f1ada637ca61 D5 v2/DS5 v2 Spot ... \n",
+ "99 001790af-f893-596a-b4f9-7b0837df43e3 DS13 Low Priority ... \n",
+ "\n",
+ " productName skuName \\\n",
+ "0 Virtual Machines D Series Windows D14 Spot \n",
+ "1 Virtual Machines D Series Windows D14 Spot \n",
+ "2 Virtual Machines Dsv5 Series Windows Standard_D64s_v5 Spot \n",
+ "3 Virtual Machines Dsv5 Series Windows Standard_D64s_v5 Spot \n",
+ "4 Standard SSD Managed Disks E10 LRS \n",
+ ".. ... ... \n",
+ "95 Virtual Machines Edsv5 Series Windows E4ds v5 Low Priority \n",
+ "96 Virtual Machines Edsv5 Series Windows E4-2ds v5 Low Priority \n",
+ "97 Virtual Machines Edsv5 Series Windows E4-2ds v5 Low Priority \n",
+ "98 Virtual Machines Dv2 Series D5 v2 Spot \n",
+ "99 Virtual Machines DS Series Windows DS13 Low Priority \n",
+ "\n",
+ " serviceName serviceId serviceFamily unitOfMeasure \\\n",
+ "0 Virtual Machines DZH313Z7MMC8 Compute 1 Hour \n",
+ "1 Virtual Machines DZH313Z7MMC8 Compute 1 Hour \n",
+ "2 Virtual Machines DZH313Z7MMC8 Compute 1 Hour \n",
+ "3 Virtual Machines DZH313Z7MMC8 Compute 1 Hour \n",
+ "4 Storage DZH317F1HKN0 Storage 1/Month \n",
+ ".. ... ... ... ... \n",
+ "95 Virtual Machines DZH313Z7MMC8 Compute 1 Hour \n",
+ "96 Virtual Machines DZH313Z7MMC8 Compute 1 Hour \n",
+ "97 Virtual Machines DZH313Z7MMC8 Compute 1 Hour \n",
+ "98 Virtual Machines DZH313Z7MMC8 Compute 1 Hour \n",
+ "99 Virtual Machines DZH313Z7MMC8 Compute 1 Hour \n",
+ "\n",
+ " type isPrimaryMeterRegion armSkuName \\\n",
+ "0 DevTestConsumption True Standard_D14 \n",
+ "1 Consumption True Standard_D14 \n",
+ "2 DevTestConsumption True Standard_D64s_v5 \n",
+ "3 Consumption True Standard_D64s_v5 \n",
+ "4 Consumption True \n",
+ ".. ... ... ... \n",
+ "95 Consumption True Standard_E4ds_v5 \n",
+ "96 DevTestConsumption False Standard_E4-2ds_v5 \n",
+ "97 Consumption False Standard_E4-2ds_v5 \n",
+ "98 Consumption True Standard_D5_v2 \n",
+ "99 Consumption False Standard_DS13 \n",
+ "\n",
+ " reservationTerm \n",
+ "0 NA \n",
+ "1 NA \n",
+ "2 NA \n",
+ "3 NA \n",
+ "4 NA \n",
+ ".. ... \n",
+ "95 NA \n",
+ "96 NA \n",
+ "97 NA \n",
+ "98 NA \n",
+ "99 NA \n",
+ "\n",
+ "[100 rows x 22 columns]"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_items_2 = df_items_2.fillna(\"NA\")\n",
+ "df_items_2"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1394fe3d",
+ "metadata": {},
+ "source": [
+ "#### Understand unique type, Typical values are Consumption and Reservation"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "b77fef63",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:18.338384Z",
+ "start_time": "2022-03-30T14:21:18.328828Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "['DevTestConsumption' 'Consumption' 'Reservation']\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(pd.unique(df_items_2[\"type\"]))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "85847f91",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:18.606000Z",
+ "start_time": "2022-03-30T14:21:18.354050Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "['NA' '1 Year' '3 Years']\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(pd.unique(df_items_2[\"reservationTerm\"]))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "59a84957",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:18.941626Z",
+ "start_time": "2022-03-30T14:21:18.610847Z"
+ }
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " currencyCode | \n",
+ " tierMinimumUnits | \n",
+ " retailPrice | \n",
+ " unitPrice | \n",
+ " armRegionName | \n",
+ " location | \n",
+ " effectiveStartDate | \n",
+ " effectiveEndDate | \n",
+ " meterId | \n",
+ " meterName | \n",
+ " ... | \n",
+ " productName | \n",
+ " skuName | \n",
+ " serviceName | \n",
+ " serviceId | \n",
+ " serviceFamily | \n",
+ " unitOfMeasure | \n",
+ " type | \n",
+ " isPrimaryMeterRegion | \n",
+ " armSkuName | \n",
+ " reservationTerm | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 1 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.542506 | \n",
+ " 0.542506 | \n",
+ " southindia | \n",
+ " IN South | \n",
+ " 2022-03-01T00:00:00Z | \n",
+ " 2022-03-31T23:59:00Z | \n",
+ " 000009d0-057f-5f2b-b7e9-9e26add324a8 | \n",
+ " D14/DS14 Spot | \n",
+ " ... | \n",
+ " Virtual Machines D Series Windows | \n",
+ " D14 Spot | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " True | \n",
+ " Standard_D14 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 1.468006 | \n",
+ " 1.468006 | \n",
+ " eastasia | \n",
+ " AP East | \n",
+ " 2022-03-01T00:00:00Z | \n",
+ " 2022-03-31T23:59:00Z | \n",
+ " 00014e7d-fff9-54dd-962e-4e992887ad3c | \n",
+ " D64s v5 Spot | \n",
+ " ... | \n",
+ " Virtual Machines Dsv5 Series Windows | \n",
+ " Standard_D64s_v5 Spot | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " True | \n",
+ " Standard_D64s_v5 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 10.560000 | \n",
+ " 10.560000 | \n",
+ " uksouth | \n",
+ " UK South | \n",
+ " 2018-11-01T00:00:00Z | \n",
+ " NA | \n",
+ " 0001d427-82df-4d83-8ab2-b60768527e08 | \n",
+ " E10 Disks | \n",
+ " ... | \n",
+ " Standard SSD Managed Disks | \n",
+ " E10 LRS | \n",
+ " Storage | \n",
+ " DZH317F1HKN0 | \n",
+ " Storage | \n",
+ " 1/Month | \n",
+ " Consumption | \n",
+ " True | \n",
+ " | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 5 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.190000 | \n",
+ " 0.190000 | \n",
+ " uknorth | \n",
+ " UK North | \n",
+ " 2019-10-16T00:00:00Z | \n",
+ " NA | \n",
+ " 0001e46a-9285-5fa8-b48a-240e307a24f7 | \n",
+ " A3 Spot | \n",
+ " ... | \n",
+ " Virtual Machines A Series Windows | \n",
+ " A3 Spot | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " True | \n",
+ " Standard_A3 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 7 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.075600 | \n",
+ " 0.075600 | \n",
+ " westus | \n",
+ " US West | \n",
+ " 2021-11-01T00:00:00Z | \n",
+ " NA | \n",
+ " 00026917-5c42-5cf2-994e-4037490635aa | \n",
+ " E2bds v5 Spot | \n",
+ " ... | \n",
+ " Virtual Machines Ebdsv5 Series | \n",
+ " Standard_E2bds_v5 Spot | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " True | \n",
+ " Standard_E2bds_v5 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 91 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 4.838000 | \n",
+ " 4.838000 | \n",
+ " southcentralus | \n",
+ " US South Central | \n",
+ " 2020-08-01T00:00:00Z | \n",
+ " NA | \n",
+ " 0016083a-928f-56fd-8eeb-39287dcf676d | \n",
+ " E64 v4 | \n",
+ " ... | \n",
+ " Virtual Machines Ev4 Series | \n",
+ " E64 v4 | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " True | \n",
+ " Standard_E64_v4 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 95 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.212000 | \n",
+ " 0.212000 | \n",
+ " westcentralus | \n",
+ " US West Central | \n",
+ " 2021-11-01T00:00:00Z | \n",
+ " NA | \n",
+ " 00172462-4604-5a25-b1d4-f057577d68e0 | \n",
+ " E4ds v5 Low Priority | \n",
+ " ... | \n",
+ " Virtual Machines Edsv5 Series Windows | \n",
+ " E4ds v5 Low Priority | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " True | \n",
+ " Standard_E4ds_v5 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 97 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.212000 | \n",
+ " 0.212000 | \n",
+ " westcentralus | \n",
+ " US West Central | \n",
+ " 2021-11-01T00:00:00Z | \n",
+ " NA | \n",
+ " 00172462-4604-5a25-b1d4-f057577d68e0 | \n",
+ " E4-2ds v5 Low Priority | \n",
+ " ... | \n",
+ " Virtual Machines Edsv5 Series Windows | \n",
+ " E4-2ds v5 Low Priority | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " False | \n",
+ " Standard_E4-2ds_v5 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 98 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.181440 | \n",
+ " 0.181440 | \n",
+ " southindia | \n",
+ " IN South | \n",
+ " 2022-03-01T00:00:00Z | \n",
+ " 2022-03-31T23:59:00Z | \n",
+ " 001752ab-2e87-599e-8fac-f1ada637ca61 | \n",
+ " D5 v2/DS5 v2 Spot | \n",
+ " ... | \n",
+ " Virtual Machines Dv2 Series | \n",
+ " D5 v2 Spot | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " True | \n",
+ " Standard_D5_v2 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ " 99 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 0.456000 | \n",
+ " 0.456000 | \n",
+ " canadacentral | \n",
+ " CA Central | \n",
+ " 2021-10-01T00:00:00Z | \n",
+ " NA | \n",
+ " 001790af-f893-596a-b4f9-7b0837df43e3 | \n",
+ " DS13 Low Priority | \n",
+ " ... | \n",
+ " Virtual Machines DS Series Windows | \n",
+ " DS13 Low Priority | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Consumption | \n",
+ " False | \n",
+ " Standard_DS13 | \n",
+ " NA | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
72 rows × 22 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " currencyCode tierMinimumUnits retailPrice unitPrice armRegionName \\\n",
+ "1 USD 0.0 0.542506 0.542506 southindia \n",
+ "3 USD 0.0 1.468006 1.468006 eastasia \n",
+ "4 USD 0.0 10.560000 10.560000 uksouth \n",
+ "5 USD 0.0 0.190000 0.190000 uknorth \n",
+ "7 USD 0.0 0.075600 0.075600 westus \n",
+ ".. ... ... ... ... ... \n",
+ "91 USD 0.0 4.838000 4.838000 southcentralus \n",
+ "95 USD 0.0 0.212000 0.212000 westcentralus \n",
+ "97 USD 0.0 0.212000 0.212000 westcentralus \n",
+ "98 USD 0.0 0.181440 0.181440 southindia \n",
+ "99 USD 0.0 0.456000 0.456000 canadacentral \n",
+ "\n",
+ " location effectiveStartDate effectiveEndDate \\\n",
+ "1 IN South 2022-03-01T00:00:00Z 2022-03-31T23:59:00Z \n",
+ "3 AP East 2022-03-01T00:00:00Z 2022-03-31T23:59:00Z \n",
+ "4 UK South 2018-11-01T00:00:00Z NA \n",
+ "5 UK North 2019-10-16T00:00:00Z NA \n",
+ "7 US West 2021-11-01T00:00:00Z NA \n",
+ ".. ... ... ... \n",
+ "91 US South Central 2020-08-01T00:00:00Z NA \n",
+ "95 US West Central 2021-11-01T00:00:00Z NA \n",
+ "97 US West Central 2021-11-01T00:00:00Z NA \n",
+ "98 IN South 2022-03-01T00:00:00Z 2022-03-31T23:59:00Z \n",
+ "99 CA Central 2021-10-01T00:00:00Z NA \n",
+ "\n",
+ " meterId meterName ... \\\n",
+ "1 000009d0-057f-5f2b-b7e9-9e26add324a8 D14/DS14 Spot ... \n",
+ "3 00014e7d-fff9-54dd-962e-4e992887ad3c D64s v5 Spot ... \n",
+ "4 0001d427-82df-4d83-8ab2-b60768527e08 E10 Disks ... \n",
+ "5 0001e46a-9285-5fa8-b48a-240e307a24f7 A3 Spot ... \n",
+ "7 00026917-5c42-5cf2-994e-4037490635aa E2bds v5 Spot ... \n",
+ ".. ... ... ... \n",
+ "91 0016083a-928f-56fd-8eeb-39287dcf676d E64 v4 ... \n",
+ "95 00172462-4604-5a25-b1d4-f057577d68e0 E4ds v5 Low Priority ... \n",
+ "97 00172462-4604-5a25-b1d4-f057577d68e0 E4-2ds v5 Low Priority ... \n",
+ "98 001752ab-2e87-599e-8fac-f1ada637ca61 D5 v2/DS5 v2 Spot ... \n",
+ "99 001790af-f893-596a-b4f9-7b0837df43e3 DS13 Low Priority ... \n",
+ "\n",
+ " productName skuName \\\n",
+ "1 Virtual Machines D Series Windows D14 Spot \n",
+ "3 Virtual Machines Dsv5 Series Windows Standard_D64s_v5 Spot \n",
+ "4 Standard SSD Managed Disks E10 LRS \n",
+ "5 Virtual Machines A Series Windows A3 Spot \n",
+ "7 Virtual Machines Ebdsv5 Series Standard_E2bds_v5 Spot \n",
+ ".. ... ... \n",
+ "91 Virtual Machines Ev4 Series E64 v4 \n",
+ "95 Virtual Machines Edsv5 Series Windows E4ds v5 Low Priority \n",
+ "97 Virtual Machines Edsv5 Series Windows E4-2ds v5 Low Priority \n",
+ "98 Virtual Machines Dv2 Series D5 v2 Spot \n",
+ "99 Virtual Machines DS Series Windows DS13 Low Priority \n",
+ "\n",
+ " serviceName serviceId serviceFamily unitOfMeasure type \\\n",
+ "1 Virtual Machines DZH313Z7MMC8 Compute 1 Hour Consumption \n",
+ "3 Virtual Machines DZH313Z7MMC8 Compute 1 Hour Consumption \n",
+ "4 Storage DZH317F1HKN0 Storage 1/Month Consumption \n",
+ "5 Virtual Machines DZH313Z7MMC8 Compute 1 Hour Consumption \n",
+ "7 Virtual Machines DZH313Z7MMC8 Compute 1 Hour Consumption \n",
+ ".. ... ... ... ... ... \n",
+ "91 Virtual Machines DZH313Z7MMC8 Compute 1 Hour Consumption \n",
+ "95 Virtual Machines DZH313Z7MMC8 Compute 1 Hour Consumption \n",
+ "97 Virtual Machines DZH313Z7MMC8 Compute 1 Hour Consumption \n",
+ "98 Virtual Machines DZH313Z7MMC8 Compute 1 Hour Consumption \n",
+ "99 Virtual Machines DZH313Z7MMC8 Compute 1 Hour Consumption \n",
+ "\n",
+ " isPrimaryMeterRegion armSkuName reservationTerm \n",
+ "1 True Standard_D14 NA \n",
+ "3 True Standard_D64s_v5 NA \n",
+ "4 True NA \n",
+ "5 True Standard_A3 NA \n",
+ "7 True Standard_E2bds_v5 NA \n",
+ ".. ... ... ... \n",
+ "91 True Standard_E64_v4 NA \n",
+ "95 True Standard_E4ds_v5 NA \n",
+ "97 False Standard_E4-2ds_v5 NA \n",
+ "98 True Standard_D5_v2 NA \n",
+ "99 False Standard_DS13 NA \n",
+ "\n",
+ "[72 rows x 22 columns]"
+ ]
+ },
+ "execution_count": 10,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_consumption = df_items_2.loc[(df_items_2[\"type\"] == \"Consumption\")]\n",
+ "df_consumption"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "id": "b88a4d4a",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:19.111848Z",
+ "start_time": "2022-03-30T14:21:18.953010Z"
+ }
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " armRegionName | \n",
+ " productName | \n",
+ " skuName | \n",
+ " retailPrice | \n",
+ " currencyCode | \n",
+ " serviceName | \n",
+ " serviceFamily | \n",
+ " reservationTerm | \n",
+ " type | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 1 | \n",
+ " southindia | \n",
+ " Virtual Machines D Series Windows | \n",
+ " D14 Spot | \n",
+ " 0.542506 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " eastasia | \n",
+ " Virtual Machines Dsv5 Series Windows | \n",
+ " Standard_D64s_v5 Spot | \n",
+ " 1.468006 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " uksouth | \n",
+ " Standard SSD Managed Disks | \n",
+ " E10 LRS | \n",
+ " 10.560000 | \n",
+ " USD | \n",
+ " Storage | \n",
+ " Storage | \n",
+ " NA | \n",
+ " Consumption | \n",
+ "
\n",
+ " \n",
+ " 5 | \n",
+ " uknorth | \n",
+ " Virtual Machines A Series Windows | \n",
+ " A3 Spot | \n",
+ " 0.190000 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ "
\n",
+ " \n",
+ " 7 | \n",
+ " westus | \n",
+ " Virtual Machines Ebdsv5 Series | \n",
+ " Standard_E2bds_v5 Spot | \n",
+ " 0.075600 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 91 | \n",
+ " southcentralus | \n",
+ " Virtual Machines Ev4 Series | \n",
+ " E64 v4 | \n",
+ " 4.838000 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ "
\n",
+ " \n",
+ " 95 | \n",
+ " westcentralus | \n",
+ " Virtual Machines Edsv5 Series Windows | \n",
+ " E4ds v5 Low Priority | \n",
+ " 0.212000 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ "
\n",
+ " \n",
+ " 97 | \n",
+ " westcentralus | \n",
+ " Virtual Machines Edsv5 Series Windows | \n",
+ " E4-2ds v5 Low Priority | \n",
+ " 0.212000 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ "
\n",
+ " \n",
+ " 98 | \n",
+ " southindia | \n",
+ " Virtual Machines Dv2 Series | \n",
+ " D5 v2 Spot | \n",
+ " 0.181440 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ "
\n",
+ " \n",
+ " 99 | \n",
+ " canadacentral | \n",
+ " Virtual Machines DS Series Windows | \n",
+ " DS13 Low Priority | \n",
+ " 0.456000 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
72 rows × 9 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " armRegionName productName \\\n",
+ "1 southindia Virtual Machines D Series Windows \n",
+ "3 eastasia Virtual Machines Dsv5 Series Windows \n",
+ "4 uksouth Standard SSD Managed Disks \n",
+ "5 uknorth Virtual Machines A Series Windows \n",
+ "7 westus Virtual Machines Ebdsv5 Series \n",
+ ".. ... ... \n",
+ "91 southcentralus Virtual Machines Ev4 Series \n",
+ "95 westcentralus Virtual Machines Edsv5 Series Windows \n",
+ "97 westcentralus Virtual Machines Edsv5 Series Windows \n",
+ "98 southindia Virtual Machines Dv2 Series \n",
+ "99 canadacentral Virtual Machines DS Series Windows \n",
+ "\n",
+ " skuName retailPrice currencyCode serviceName \\\n",
+ "1 D14 Spot 0.542506 USD Virtual Machines \n",
+ "3 Standard_D64s_v5 Spot 1.468006 USD Virtual Machines \n",
+ "4 E10 LRS 10.560000 USD Storage \n",
+ "5 A3 Spot 0.190000 USD Virtual Machines \n",
+ "7 Standard_E2bds_v5 Spot 0.075600 USD Virtual Machines \n",
+ ".. ... ... ... ... \n",
+ "91 E64 v4 4.838000 USD Virtual Machines \n",
+ "95 E4ds v5 Low Priority 0.212000 USD Virtual Machines \n",
+ "97 E4-2ds v5 Low Priority 0.212000 USD Virtual Machines \n",
+ "98 D5 v2 Spot 0.181440 USD Virtual Machines \n",
+ "99 DS13 Low Priority 0.456000 USD Virtual Machines \n",
+ "\n",
+ " serviceFamily reservationTerm type \n",
+ "1 Compute NA Consumption \n",
+ "3 Compute NA Consumption \n",
+ "4 Storage NA Consumption \n",
+ "5 Compute NA Consumption \n",
+ "7 Compute NA Consumption \n",
+ ".. ... ... ... \n",
+ "91 Compute NA Consumption \n",
+ "95 Compute NA Consumption \n",
+ "97 Compute NA Consumption \n",
+ "98 Compute NA Consumption \n",
+ "99 Compute NA Consumption \n",
+ "\n",
+ "[72 rows x 9 columns]"
+ ]
+ },
+ "execution_count": 11,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "dfi_consumption = df_consumption[\n",
+ " [\n",
+ " \"armRegionName\",\n",
+ " \"productName\",\n",
+ " \"skuName\",\n",
+ " \"retailPrice\",\n",
+ " \"currencyCode\",\n",
+ " \"serviceName\",\n",
+ " \"serviceFamily\",\n",
+ " \"reservationTerm\",\n",
+ " \"type\",\n",
+ " ]\n",
+ "]\n",
+ "dfi_consumption"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ff60a690",
+ "metadata": {},
+ "source": [
+ "#### Group by few columns to get region wise Max Price and Min Price"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "id": "3e8510f9",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:19.321020Z",
+ "start_time": "2022-03-30T14:21:19.119142Z"
+ }
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " maxPrice | \n",
+ " minPrice | \n",
+ "
\n",
+ " \n",
+ " armRegionName | \n",
+ " productName | \n",
+ " skuName | \n",
+ " serviceName | \n",
+ " serviceFamily | \n",
+ " reservationTerm | \n",
+ " type | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | \n",
+ " SQL Server Web Red Hat Enterprise Linux | \n",
+ " 7 vCPU VM | \n",
+ " Virtual Machines Licenses | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ " 0.186000 | \n",
+ " 0.186000 | \n",
+ "
\n",
+ " \n",
+ " australiaeast | \n",
+ " Virtual Machines Esv4 Series Windows | \n",
+ " E64-16s v4 Spot | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ " 2.057530 | \n",
+ " 2.057530 | \n",
+ "
\n",
+ " \n",
+ " australiasoutheast | \n",
+ " Virtual Machines Eadsv5 Series Windows | \n",
+ " E16-8ads v5 Spot | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ " 0.537088 | \n",
+ " 0.537088 | \n",
+ "
\n",
+ " \n",
+ " Virtual Machines F Series Windows | \n",
+ " F16 Spot | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ " 0.403024 | \n",
+ " 0.403024 | \n",
+ "
\n",
+ " \n",
+ " brazilsouth | \n",
+ " Virtual Machines A Series Basic | \n",
+ " A2 | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ " 0.112000 | \n",
+ " 0.112000 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " westindia | \n",
+ " Virtual Machines Dv4 Series | \n",
+ " D2 v4 Low Priority | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ " 0.023600 | \n",
+ " 0.023600 | \n",
+ "
\n",
+ " \n",
+ " westus | \n",
+ " Premium ADLS Gen2 Hierarchical Namespace | \n",
+ " Premium ZRS | \n",
+ " Storage | \n",
+ " Storage | \n",
+ " NA | \n",
+ " Consumption | \n",
+ " 0.113000 | \n",
+ " 0.113000 | \n",
+ "
\n",
+ " \n",
+ " Virtual Machines Ebdsv5 Series | \n",
+ " Standard_E2bds_v5 Spot | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ " 0.075600 | \n",
+ " 0.075600 | \n",
+ "
\n",
+ " \n",
+ " westus2 | \n",
+ " Virtual Machines Ddsv5 Series | \n",
+ " Standard_D64ds_v5 | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " NA | \n",
+ " Consumption | \n",
+ " 3.616000 | \n",
+ " 3.616000 | \n",
+ "
\n",
+ " \n",
+ " westus3 | \n",
+ " Azure Redis Cache Enterprise Flash | \n",
+ " F1500 | \n",
+ " Redis Cache | \n",
+ " Databases | \n",
+ " NA | \n",
+ " Consumption | \n",
+ " 10.430000 | \n",
+ " 10.430000 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
67 rows × 2 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " maxPrice \\\n",
+ "armRegionName productName skuName serviceName serviceFamily reservationTerm type \n",
+ " SQL Server Web Red Hat Enterprise Linux 7 vCPU VM Virtual Machines Licenses Compute NA Consumption 0.186000 \n",
+ "australiaeast Virtual Machines Esv4 Series Windows E64-16s v4 Spot Virtual Machines Compute NA Consumption 2.057530 \n",
+ "australiasoutheast Virtual Machines Eadsv5 Series Windows E16-8ads v5 Spot Virtual Machines Compute NA Consumption 0.537088 \n",
+ " Virtual Machines F Series Windows F16 Spot Virtual Machines Compute NA Consumption 0.403024 \n",
+ "brazilsouth Virtual Machines A Series Basic A2 Virtual Machines Compute NA Consumption 0.112000 \n",
+ "... ... \n",
+ "westindia Virtual Machines Dv4 Series D2 v4 Low Priority Virtual Machines Compute NA Consumption 0.023600 \n",
+ "westus Premium ADLS Gen2 Hierarchical Namespace Premium ZRS Storage Storage NA Consumption 0.113000 \n",
+ " Virtual Machines Ebdsv5 Series Standard_E2bds_v5 Spot Virtual Machines Compute NA Consumption 0.075600 \n",
+ "westus2 Virtual Machines Ddsv5 Series Standard_D64ds_v5 Virtual Machines Compute NA Consumption 3.616000 \n",
+ "westus3 Azure Redis Cache Enterprise Flash F1500 Redis Cache Databases NA Consumption 10.430000 \n",
+ "\n",
+ " minPrice \n",
+ "armRegionName productName skuName serviceName serviceFamily reservationTerm type \n",
+ " SQL Server Web Red Hat Enterprise Linux 7 vCPU VM Virtual Machines Licenses Compute NA Consumption 0.186000 \n",
+ "australiaeast Virtual Machines Esv4 Series Windows E64-16s v4 Spot Virtual Machines Compute NA Consumption 2.057530 \n",
+ "australiasoutheast Virtual Machines Eadsv5 Series Windows E16-8ads v5 Spot Virtual Machines Compute NA Consumption 0.537088 \n",
+ " Virtual Machines F Series Windows F16 Spot Virtual Machines Compute NA Consumption 0.403024 \n",
+ "brazilsouth Virtual Machines A Series Basic A2 Virtual Machines Compute NA Consumption 0.112000 \n",
+ "... ... \n",
+ "westindia Virtual Machines Dv4 Series D2 v4 Low Priority Virtual Machines Compute NA Consumption 0.023600 \n",
+ "westus Premium ADLS Gen2 Hierarchical Namespace Premium ZRS Storage Storage NA Consumption 0.113000 \n",
+ " Virtual Machines Ebdsv5 Series Standard_E2bds_v5 Spot Virtual Machines Compute NA Consumption 0.075600 \n",
+ "westus2 Virtual Machines Ddsv5 Series Standard_D64ds_v5 Virtual Machines Compute NA Consumption 3.616000 \n",
+ "westus3 Azure Redis Cache Enterprise Flash F1500 Redis Cache Databases NA Consumption 10.430000 \n",
+ "\n",
+ "[67 rows x 2 columns]"
+ ]
+ },
+ "execution_count": 12,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "result_consumption = dfi_consumption.groupby(\n",
+ " [\n",
+ " \"armRegionName\",\n",
+ " \"productName\",\n",
+ " \"skuName\",\n",
+ " \"serviceName\",\n",
+ " \"serviceFamily\",\n",
+ " \"reservationTerm\",\n",
+ " \"type\",\n",
+ " ]\n",
+ ").agg(maxPrice=(\"retailPrice\", \"max\"), minPrice=(\"retailPrice\", \"min\"))\n",
+ "result_consumption"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2a59fc3f",
+ "metadata": {},
+ "source": [
+ "#### Data analysis to understand service prices for type Reservation"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "id": "addfcc59",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:19.484511Z",
+ "start_time": "2022-03-30T14:21:19.325994Z"
+ }
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " currencyCode | \n",
+ " tierMinimumUnits | \n",
+ " retailPrice | \n",
+ " unitPrice | \n",
+ " armRegionName | \n",
+ " location | \n",
+ " effectiveStartDate | \n",
+ " effectiveEndDate | \n",
+ " meterId | \n",
+ " meterName | \n",
+ " ... | \n",
+ " productName | \n",
+ " skuName | \n",
+ " serviceName | \n",
+ " serviceId | \n",
+ " serviceFamily | \n",
+ " unitOfMeasure | \n",
+ " type | \n",
+ " isPrimaryMeterRegion | \n",
+ " armSkuName | \n",
+ " reservationTerm | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 36 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 18689.0 | \n",
+ " 18689.0 | \n",
+ " westus2 | \n",
+ " US West 2 | \n",
+ " 2021-11-01T00:00:00Z | \n",
+ " NA | \n",
+ " 000aeefc-dae5-5264-8f64-d0838e160478 | \n",
+ " D64ds v5 | \n",
+ " ... | \n",
+ " Virtual Machines Ddsv5 Series | \n",
+ " Standard_D64ds_v5 | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Reservation | \n",
+ " True | \n",
+ " Standard_D64ds_v5 | \n",
+ " 1 Year | \n",
+ "
\n",
+ " \n",
+ " 37 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 36111.0 | \n",
+ " 36111.0 | \n",
+ " westus2 | \n",
+ " US West 2 | \n",
+ " 2021-11-01T00:00:00Z | \n",
+ " NA | \n",
+ " 000aeefc-dae5-5264-8f64-d0838e160478 | \n",
+ " D64ds v5 | \n",
+ " ... | \n",
+ " Virtual Machines Ddsv5 Series | \n",
+ " Standard_D64ds_v5 | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Reservation | \n",
+ " True | \n",
+ " Standard_D64ds_v5 | \n",
+ " 3 Years | \n",
+ "
\n",
+ " \n",
+ " 43 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 39231.0 | \n",
+ " 39231.0 | \n",
+ " koreasouth | \n",
+ " KR South | \n",
+ " 2021-12-01T00:00:00Z | \n",
+ " NA | \n",
+ " 000c0948-0687-52ed-8efa-32a3cfa6c9ed | \n",
+ " Easv4 Type2 | \n",
+ " ... | \n",
+ " Easv4 Series Dedicated Host | \n",
+ " Easv4 Type2 | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Reservation | \n",
+ " True | \n",
+ " Easv4_Type2 | \n",
+ " 1 Year | \n",
+ "
\n",
+ " \n",
+ " 45 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 77890.0 | \n",
+ " 77890.0 | \n",
+ " koreasouth | \n",
+ " KR South | \n",
+ " 2021-12-01T00:00:00Z | \n",
+ " NA | \n",
+ " 000c0948-0687-52ed-8efa-32a3cfa6c9ed | \n",
+ " Easv4 Type2 | \n",
+ " ... | \n",
+ " Easv4 Series Dedicated Host | \n",
+ " Easv4 Type2 | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Reservation | \n",
+ " True | \n",
+ " Easv4_Type2 | \n",
+ " 3 Years | \n",
+ "
\n",
+ " \n",
+ " 82 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 38667.0 | \n",
+ " 38667.0 | \n",
+ " usgovarizona | \n",
+ " US Gov AZ | \n",
+ " 2020-08-01T00:00:00Z | \n",
+ " NA | \n",
+ " 0014a546-6717-582f-9680-e510e91eae91 | \n",
+ " D64s v4 | \n",
+ " ... | \n",
+ " Virtual Machines Dsv4 Series | \n",
+ " D64s v4 | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Reservation | \n",
+ " True | \n",
+ " Standard_D64s_v4 | \n",
+ " 3 Years | \n",
+ "
\n",
+ " \n",
+ " 83 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 20012.0 | \n",
+ " 20012.0 | \n",
+ " usgovarizona | \n",
+ " US Gov AZ | \n",
+ " 2020-08-01T00:00:00Z | \n",
+ " NA | \n",
+ " 0014a546-6717-582f-9680-e510e91eae91 | \n",
+ " D64s v4 | \n",
+ " ... | \n",
+ " Virtual Machines Dsv4 Series | \n",
+ " D64s v4 | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Reservation | \n",
+ " True | \n",
+ " Standard_D64s_v4 | \n",
+ " 1 Year | \n",
+ "
\n",
+ " \n",
+ " 92 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 48318.0 | \n",
+ " 48318.0 | \n",
+ " southcentralus | \n",
+ " US South Central | \n",
+ " 2020-08-01T00:00:00Z | \n",
+ " NA | \n",
+ " 0016083a-928f-56fd-8eeb-39287dcf676d | \n",
+ " E64 v4 | \n",
+ " ... | \n",
+ " Virtual Machines Ev4 Series | \n",
+ " E64 v4 | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Reservation | \n",
+ " True | \n",
+ " Standard_E64_v4 | \n",
+ " 3 Years | \n",
+ "
\n",
+ " \n",
+ " 93 | \n",
+ " USD | \n",
+ " 0.0 | \n",
+ " 25007.0 | \n",
+ " 25007.0 | \n",
+ " southcentralus | \n",
+ " US South Central | \n",
+ " 2020-08-01T00:00:00Z | \n",
+ " NA | \n",
+ " 0016083a-928f-56fd-8eeb-39287dcf676d | \n",
+ " E64 v4 | \n",
+ " ... | \n",
+ " Virtual Machines Ev4 Series | \n",
+ " E64 v4 | \n",
+ " Virtual Machines | \n",
+ " DZH313Z7MMC8 | \n",
+ " Compute | \n",
+ " 1 Hour | \n",
+ " Reservation | \n",
+ " True | \n",
+ " Standard_E64_v4 | \n",
+ " 1 Year | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
8 rows × 22 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " currencyCode tierMinimumUnits retailPrice unitPrice armRegionName \\\n",
+ "36 USD 0.0 18689.0 18689.0 westus2 \n",
+ "37 USD 0.0 36111.0 36111.0 westus2 \n",
+ "43 USD 0.0 39231.0 39231.0 koreasouth \n",
+ "45 USD 0.0 77890.0 77890.0 koreasouth \n",
+ "82 USD 0.0 38667.0 38667.0 usgovarizona \n",
+ "83 USD 0.0 20012.0 20012.0 usgovarizona \n",
+ "92 USD 0.0 48318.0 48318.0 southcentralus \n",
+ "93 USD 0.0 25007.0 25007.0 southcentralus \n",
+ "\n",
+ " location effectiveStartDate effectiveEndDate \\\n",
+ "36 US West 2 2021-11-01T00:00:00Z NA \n",
+ "37 US West 2 2021-11-01T00:00:00Z NA \n",
+ "43 KR South 2021-12-01T00:00:00Z NA \n",
+ "45 KR South 2021-12-01T00:00:00Z NA \n",
+ "82 US Gov AZ 2020-08-01T00:00:00Z NA \n",
+ "83 US Gov AZ 2020-08-01T00:00:00Z NA \n",
+ "92 US South Central 2020-08-01T00:00:00Z NA \n",
+ "93 US South Central 2020-08-01T00:00:00Z NA \n",
+ "\n",
+ " meterId meterName ... \\\n",
+ "36 000aeefc-dae5-5264-8f64-d0838e160478 D64ds v5 ... \n",
+ "37 000aeefc-dae5-5264-8f64-d0838e160478 D64ds v5 ... \n",
+ "43 000c0948-0687-52ed-8efa-32a3cfa6c9ed Easv4 Type2 ... \n",
+ "45 000c0948-0687-52ed-8efa-32a3cfa6c9ed Easv4 Type2 ... \n",
+ "82 0014a546-6717-582f-9680-e510e91eae91 D64s v4 ... \n",
+ "83 0014a546-6717-582f-9680-e510e91eae91 D64s v4 ... \n",
+ "92 0016083a-928f-56fd-8eeb-39287dcf676d E64 v4 ... \n",
+ "93 0016083a-928f-56fd-8eeb-39287dcf676d E64 v4 ... \n",
+ "\n",
+ " productName skuName serviceName \\\n",
+ "36 Virtual Machines Ddsv5 Series Standard_D64ds_v5 Virtual Machines \n",
+ "37 Virtual Machines Ddsv5 Series Standard_D64ds_v5 Virtual Machines \n",
+ "43 Easv4 Series Dedicated Host Easv4 Type2 Virtual Machines \n",
+ "45 Easv4 Series Dedicated Host Easv4 Type2 Virtual Machines \n",
+ "82 Virtual Machines Dsv4 Series D64s v4 Virtual Machines \n",
+ "83 Virtual Machines Dsv4 Series D64s v4 Virtual Machines \n",
+ "92 Virtual Machines Ev4 Series E64 v4 Virtual Machines \n",
+ "93 Virtual Machines Ev4 Series E64 v4 Virtual Machines \n",
+ "\n",
+ " serviceId serviceFamily unitOfMeasure type \\\n",
+ "36 DZH313Z7MMC8 Compute 1 Hour Reservation \n",
+ "37 DZH313Z7MMC8 Compute 1 Hour Reservation \n",
+ "43 DZH313Z7MMC8 Compute 1 Hour Reservation \n",
+ "45 DZH313Z7MMC8 Compute 1 Hour Reservation \n",
+ "82 DZH313Z7MMC8 Compute 1 Hour Reservation \n",
+ "83 DZH313Z7MMC8 Compute 1 Hour Reservation \n",
+ "92 DZH313Z7MMC8 Compute 1 Hour Reservation \n",
+ "93 DZH313Z7MMC8 Compute 1 Hour Reservation \n",
+ "\n",
+ " isPrimaryMeterRegion armSkuName reservationTerm \n",
+ "36 True Standard_D64ds_v5 1 Year \n",
+ "37 True Standard_D64ds_v5 3 Years \n",
+ "43 True Easv4_Type2 1 Year \n",
+ "45 True Easv4_Type2 3 Years \n",
+ "82 True Standard_D64s_v4 3 Years \n",
+ "83 True Standard_D64s_v4 1 Year \n",
+ "92 True Standard_E64_v4 3 Years \n",
+ "93 True Standard_E64_v4 1 Year \n",
+ "\n",
+ "[8 rows x 22 columns]"
+ ]
+ },
+ "execution_count": 13,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_reservation = df_items_2.loc[(df_items_2[\"type\"] == \"Reservation\")]\n",
+ "df_reservation"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "id": "f0e7b612",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:19.602264Z",
+ "start_time": "2022-03-30T14:21:19.492848Z"
+ }
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " armRegionName | \n",
+ " productName | \n",
+ " skuName | \n",
+ " retailPrice | \n",
+ " currencyCode | \n",
+ " serviceName | \n",
+ " serviceFamily | \n",
+ " reservationTerm | \n",
+ " type | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 36 | \n",
+ " westus2 | \n",
+ " Virtual Machines Ddsv5 Series | \n",
+ " Standard_D64ds_v5 | \n",
+ " 18689.0 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " 1 Year | \n",
+ " Reservation | \n",
+ "
\n",
+ " \n",
+ " 37 | \n",
+ " westus2 | \n",
+ " Virtual Machines Ddsv5 Series | \n",
+ " Standard_D64ds_v5 | \n",
+ " 36111.0 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " 3 Years | \n",
+ " Reservation | \n",
+ "
\n",
+ " \n",
+ " 43 | \n",
+ " koreasouth | \n",
+ " Easv4 Series Dedicated Host | \n",
+ " Easv4 Type2 | \n",
+ " 39231.0 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " 1 Year | \n",
+ " Reservation | \n",
+ "
\n",
+ " \n",
+ " 45 | \n",
+ " koreasouth | \n",
+ " Easv4 Series Dedicated Host | \n",
+ " Easv4 Type2 | \n",
+ " 77890.0 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " 3 Years | \n",
+ " Reservation | \n",
+ "
\n",
+ " \n",
+ " 82 | \n",
+ " usgovarizona | \n",
+ " Virtual Machines Dsv4 Series | \n",
+ " D64s v4 | \n",
+ " 38667.0 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " 3 Years | \n",
+ " Reservation | \n",
+ "
\n",
+ " \n",
+ " 83 | \n",
+ " usgovarizona | \n",
+ " Virtual Machines Dsv4 Series | \n",
+ " D64s v4 | \n",
+ " 20012.0 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " 1 Year | \n",
+ " Reservation | \n",
+ "
\n",
+ " \n",
+ " 92 | \n",
+ " southcentralus | \n",
+ " Virtual Machines Ev4 Series | \n",
+ " E64 v4 | \n",
+ " 48318.0 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " 3 Years | \n",
+ " Reservation | \n",
+ "
\n",
+ " \n",
+ " 93 | \n",
+ " southcentralus | \n",
+ " Virtual Machines Ev4 Series | \n",
+ " E64 v4 | \n",
+ " 25007.0 | \n",
+ " USD | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " 1 Year | \n",
+ " Reservation | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " armRegionName productName skuName \\\n",
+ "36 westus2 Virtual Machines Ddsv5 Series Standard_D64ds_v5 \n",
+ "37 westus2 Virtual Machines Ddsv5 Series Standard_D64ds_v5 \n",
+ "43 koreasouth Easv4 Series Dedicated Host Easv4 Type2 \n",
+ "45 koreasouth Easv4 Series Dedicated Host Easv4 Type2 \n",
+ "82 usgovarizona Virtual Machines Dsv4 Series D64s v4 \n",
+ "83 usgovarizona Virtual Machines Dsv4 Series D64s v4 \n",
+ "92 southcentralus Virtual Machines Ev4 Series E64 v4 \n",
+ "93 southcentralus Virtual Machines Ev4 Series E64 v4 \n",
+ "\n",
+ " retailPrice currencyCode serviceName serviceFamily reservationTerm \\\n",
+ "36 18689.0 USD Virtual Machines Compute 1 Year \n",
+ "37 36111.0 USD Virtual Machines Compute 3 Years \n",
+ "43 39231.0 USD Virtual Machines Compute 1 Year \n",
+ "45 77890.0 USD Virtual Machines Compute 3 Years \n",
+ "82 38667.0 USD Virtual Machines Compute 3 Years \n",
+ "83 20012.0 USD Virtual Machines Compute 1 Year \n",
+ "92 48318.0 USD Virtual Machines Compute 3 Years \n",
+ "93 25007.0 USD Virtual Machines Compute 1 Year \n",
+ "\n",
+ " type \n",
+ "36 Reservation \n",
+ "37 Reservation \n",
+ "43 Reservation \n",
+ "45 Reservation \n",
+ "82 Reservation \n",
+ "83 Reservation \n",
+ "92 Reservation \n",
+ "93 Reservation "
+ ]
+ },
+ "execution_count": 14,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "dfi_reservation = df_reservation[\n",
+ " [\n",
+ " \"armRegionName\",\n",
+ " \"productName\",\n",
+ " \"skuName\",\n",
+ " \"retailPrice\",\n",
+ " \"currencyCode\",\n",
+ " \"serviceName\",\n",
+ " \"serviceFamily\",\n",
+ " \"reservationTerm\",\n",
+ " \"type\",\n",
+ " ]\n",
+ "]\n",
+ "dfi_reservation"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "id": "c1811bff",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-30T14:21:24.227201Z",
+ "start_time": "2022-03-30T14:21:23.563953Z"
+ },
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " maxPrice | \n",
+ " minPrice | \n",
+ "
\n",
+ " \n",
+ " armRegionName | \n",
+ " productName | \n",
+ " skuName | \n",
+ " serviceName | \n",
+ " serviceFamily | \n",
+ " reservationTerm | \n",
+ " type | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " koreasouth | \n",
+ " Easv4 Series Dedicated Host | \n",
+ " Easv4 Type2 | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " 1 Year | \n",
+ " Reservation | \n",
+ " 39231.0 | \n",
+ " 39231.0 | \n",
+ "
\n",
+ " \n",
+ " 3 Years | \n",
+ " Reservation | \n",
+ " 77890.0 | \n",
+ " 77890.0 | \n",
+ "
\n",
+ " \n",
+ " southcentralus | \n",
+ " Virtual Machines Ev4 Series | \n",
+ " E64 v4 | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " 1 Year | \n",
+ " Reservation | \n",
+ " 25007.0 | \n",
+ " 25007.0 | \n",
+ "
\n",
+ " \n",
+ " 3 Years | \n",
+ " Reservation | \n",
+ " 48318.0 | \n",
+ " 48318.0 | \n",
+ "
\n",
+ " \n",
+ " usgovarizona | \n",
+ " Virtual Machines Dsv4 Series | \n",
+ " D64s v4 | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " 1 Year | \n",
+ " Reservation | \n",
+ " 20012.0 | \n",
+ " 20012.0 | \n",
+ "
\n",
+ " \n",
+ " 3 Years | \n",
+ " Reservation | \n",
+ " 38667.0 | \n",
+ " 38667.0 | \n",
+ "
\n",
+ " \n",
+ " westus2 | \n",
+ " Virtual Machines Ddsv5 Series | \n",
+ " Standard_D64ds_v5 | \n",
+ " Virtual Machines | \n",
+ " Compute | \n",
+ " 1 Year | \n",
+ " Reservation | \n",
+ " 18689.0 | \n",
+ " 18689.0 | \n",
+ "
\n",
+ " \n",
+ " 3 Years | \n",
+ " Reservation | \n",
+ " 36111.0 | \n",
+ " 36111.0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " maxPrice \\\n",
+ "armRegionName productName skuName serviceName serviceFamily reservationTerm type \n",
+ "koreasouth Easv4 Series Dedicated Host Easv4 Type2 Virtual Machines Compute 1 Year Reservation 39231.0 \n",
+ " 3 Years Reservation 77890.0 \n",
+ "southcentralus Virtual Machines Ev4 Series E64 v4 Virtual Machines Compute 1 Year Reservation 25007.0 \n",
+ " 3 Years Reservation 48318.0 \n",
+ "usgovarizona Virtual Machines Dsv4 Series D64s v4 Virtual Machines Compute 1 Year Reservation 20012.0 \n",
+ " 3 Years Reservation 38667.0 \n",
+ "westus2 Virtual Machines Ddsv5 Series Standard_D64ds_v5 Virtual Machines Compute 1 Year Reservation 18689.0 \n",
+ " 3 Years Reservation 36111.0 \n",
+ "\n",
+ " minPrice \n",
+ "armRegionName productName skuName serviceName serviceFamily reservationTerm type \n",
+ "koreasouth Easv4 Series Dedicated Host Easv4 Type2 Virtual Machines Compute 1 Year Reservation 39231.0 \n",
+ " 3 Years Reservation 77890.0 \n",
+ "southcentralus Virtual Machines Ev4 Series E64 v4 Virtual Machines Compute 1 Year Reservation 25007.0 \n",
+ " 3 Years Reservation 48318.0 \n",
+ "usgovarizona Virtual Machines Dsv4 Series D64s v4 Virtual Machines Compute 1 Year Reservation 20012.0 \n",
+ " 3 Years Reservation 38667.0 \n",
+ "westus2 Virtual Machines Ddsv5 Series Standard_D64ds_v5 Virtual Machines Compute 1 Year Reservation 18689.0 \n",
+ " 3 Years Reservation 36111.0 "
+ ]
+ },
+ "execution_count": 15,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "result_reservation = dfi_reservation.groupby(\n",
+ " [\n",
+ " \"armRegionName\",\n",
+ " \"productName\",\n",
+ " \"skuName\",\n",
+ " \"serviceName\",\n",
+ " \"serviceFamily\",\n",
+ " \"reservationTerm\",\n",
+ " \"type\",\n",
+ " ]\n",
+ ").agg(maxPrice=(\"retailPrice\", \"max\"), minPrice=(\"retailPrice\", \"min\"))\n",
+ "result_reservation"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "058b5701",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2022-03-29T13:38:17.721934Z",
+ "start_time": "2022-03-29T13:38:17.710284Z"
+ }
+ },
+ "source": [
+ "#### Conclusion - \n",
+ "For the type Consumption In most of the cases across regions, there is slight variation between min and max price\n",
+ "For the type Reservation prices are fixed. Max min price analysis is not required."
+ ]
+ }
+ ],
+ "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.10.2"
+ },
+ "toc": {
+ "base_numbering": 1,
+ "nav_menu": {},
+ "number_sections": true,
+ "sideBar": true,
+ "skip_h1_title": false,
+ "title_cell": "Table of Contents",
+ "title_sidebar": "Contents",
+ "toc_cell": false,
+ "toc_position": {},
+ "toc_section_display": true,
+ "toc_window_display": false
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}