{"id":46721,"date":"2022-09-07T00:00:00","date_gmt":"2022-09-07T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/"},"modified":"2025-11-13T12:56:13","modified_gmt":"2025-11-13T20:56:13","slug":"sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python","status":"publish","type":"post","link":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/","title":{"rendered":"Sky-rocketing Prices &#038; Inflation- An Analysis using GridDB and Python"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>In recent times, the popularity of the search terms &#8216;Inflation&#8217;, &#8216;Shortage&#8217;, &#8216;Food Prices&#8217; and &#8216;Gas Prices&#8217; have gone up by 100-140 % (Source: Google Trends). There&#8217;s no doubt that people all over the world are worried about food and gas prices going up. It goes without saying that sky-rocketing and inflated prices of commodities like food, gasoline and household fuels can have a cataclysmic effect on the quality of life, especially affecting small families. Hence, it is important to analyze and stay informed of the trends in prices of commodities for sustenance and survival. GridDB and Python together will be used in this crucial analysis.<\/p>\n<p>Here&#8217;s a link to the jupyter file: <a href=\"https:\/\/github.com\/griddbnet\/Blogs\/tree\/inflation_cpi\">https:\/\/github.com\/griddbnet\/Blogs\/tree\/inflation_cpi<\/a><\/p>\n<h3>About the Dataset<\/h3>\n<p>The dataset in hand is a time series dataset obtained from the <a href=\"https:\/\/www.bls.gov\/\">U.S Bureau Labor of Statistics<\/a>. The Dataset can be downloaded <a href=\"https:\/\/www.bls.gov\/cpi\/data.htm\">here<\/a>. Download the text files from the &#8216;Average Price Data&#8217; section in the website (highlighted below).<\/p>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-2.jpeg\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-2.jpeg\" alt=\"\" width=\"1167\" height=\"717\" class=\"aligncenter size-full wp-image-28635\" srcset=\"\/wp-content\/uploads\/2022\/08\/download-2.jpeg 1167w, \/wp-content\/uploads\/2022\/08\/download-2-300x184.jpeg 300w, \/wp-content\/uploads\/2022\/08\/download-2-1024x629.jpeg 1024w, \/wp-content\/uploads\/2022\/08\/download-2-768x472.jpeg 768w, \/wp-content\/uploads\/2022\/08\/download-2-600x369.jpeg 600w\" sizes=\"(max-width: 1167px) 100vw, 1167px\" \/><\/a><\/p>\n<p>The text files highlighted in the image below have been used for the analysis &#8211;<\/p>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-3.jpeg\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-3.jpeg\" alt=\"\" width=\"634\" height=\"303\" class=\"aligncenter size-full wp-image-28634\" srcset=\"\/wp-content\/uploads\/2022\/08\/download-3.jpeg 634w, \/wp-content\/uploads\/2022\/08\/download-3-300x143.jpeg 300w, \/wp-content\/uploads\/2022\/08\/download-3-600x287.jpeg 600w\" sizes=\"(max-width: 634px) 100vw, 634px\" \/><\/a><\/p>\n<h3>Planning the load process to GridDB\/Understanding the Size of the Dataset<\/h3>\n<p>It&#8217;s important to understand the size of the dataset so that we can plan out the process to load the data into GridDB. This is important so as to not put a huge burden on the system where the program is running (client system). The datasets have more than 40 years of data which gives us good scope to do some analysis on price trends.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">import os\nimport numpy as np\nimport pandas as pd\nimport nums_from_string as ns\nfrom IPython.core.display import Image, display\nimport seaborn as sns\nfrom matplotlib import pyplot as plt\n<\/code><\/pre>\n<\/div>\n<p>Note that these text files are fixed width files. Hence, the fixed width files need to be downloaded using the read_fwf function of pandas.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">household_prices = pd.read_fwf('ap.data.1.HouseholdFuels.txt')\ngasoline_prices = pd.read_fwf('ap.data.2.Gasoline.txt')\nfood_prices = pd.read_fwf('ap.data.3.Food.txt')<\/code><\/pre>\n<\/div>\n<p>Let&#8217;s now look at the memory utilized by the dataframes.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">print('Size of household_prices', household_prices.info(memory_usage='deep'))\nprint('Size of food_prices', food_prices.info(memory_usage='deep'))\nprint('Size of gasoline_prices', gasoline_prices.info(memory_usage='deep'))<\/code><\/pre>\n<\/div>\n<pre><code>&lt;class 'pandas.core.frame.DataFrame'&gt;\nRangeIndex: 103139 entries, 0 to 103138\nData columns (total 5 columns):\n #   Column          Non-Null Count   Dtype  \n---  ------          --------------   -----  \n 0   series_id       103139 non-null  object \n 1   year            103139 non-null  int64  \n 2   period          103139 non-null  object \n 3   value           103139 non-null  object \n 4   footnote_codes  0 non-null       float64\ndtypes: float64(1), int64(1), object(3)\nmemory usage: 20.4 MB\nSize of household_prices None\n&lt;class 'pandas.core.frame.DataFrame'&gt;\nRangeIndex: 139986 entries, 0 to 139985\nData columns (total 5 columns):\n #   Column          Non-Null Count   Dtype  \n---  ------          --------------   -----  \n 0   series_id       139986 non-null  object \n 1   year            139986 non-null  int64  \n 2   period          139986 non-null  object \n 3   value           139986 non-null  object \n 4   footnote_codes  0 non-null       float64\ndtypes: float64(1), int64(1), object(3)\nmemory usage: 27.8 MB\nSize of food_prices None\n&lt;class 'pandas.core.frame.DataFrame'&gt;\nRangeIndex: 88754 entries, 0 to 88753\nData columns (total 5 columns):\n #   Column          Non-Null Count  Dtype  \n---  ------          --------------  -----  \n 0   series_id       88754 non-null  object \n 1   year            88754 non-null  int64  \n 2   period          88754 non-null  object \n 3   value           88754 non-null  float64\n 4   footnote_codes  0 non-null      float64\ndtypes: float64(2), int64(1), object(2)\nmemory usage: 13.0 MB\nSize of gasoline_prices None\n<\/code><\/pre>\n<p>As seen above, the size of the &#8216;household_prices&#8217;, &#8216;food_prices&#8217; and &#8216;gasoline_prices&#8217; datasets when loaded into memory are 22.7MB, 28.7 MB and 18.5 MB respectively. This brings us to a total of 69.9 MB. Hence, an efficient load strategy would be needed while loading the data into GridDB.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">print(len(household_prices))\nprint(len(gasoline_prices))\nprint(len(food_prices))<\/code><\/pre>\n<\/div>\n<pre><code>103139\n88754\n139986\n<\/code><\/pre>\n<p>The above gives us a reference to the number of records that will be processed\/loaded into GridDB.<\/p>\n<p>An efficient load strategy would be to chunk the data into 1000 rows each and load them into GridDB one chunk at a time. This will result in multiple invocations of the GridDB API to load the data. But this will allow us greater control on the data being loaded. ALternatively, the entire data can be loaded in one shot too but that may utilize a lot of memory and bandwidth (ensure that any timeouts on the HTTP connection are configured leniently in this case).<\/p>\n<h3>Data Cleaning<\/h3>\n<p>Let&#8217;s perform some data cleaning before loading the data into GridDB.<br \/>\nFirst, let&#8217;s add a &#8220;Category&#8221; field that will store the type of data. This way we are able to identify the source of a record in case that is needed in the future.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">household_prices['Category'] = 'Household Commodities'\ngasoline_prices['Category'] = 'Gasoline'\nfood_prices['Category'] = 'Food'<\/code><\/pre>\n<\/div>\n<p>Let&#8217;s now define a function that will remove unneeded columns, extract the month number from the period field, perform data cleaning in the value field to ensure that all data is numeric and finally, order the columns in the dataframe.<br \/>\nOnce done, we will invoke this function against the 3 datasets (dataframes) that were loaded.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">def data_cleaning (df):\n    df.drop('footnote_codes', axis=1, inplace=True) # Delete the column 'footnote_codes'\n    df['month'] = df['period'].str[-2:] #extract the month\n    # DataType conversions\n    df[\"month\"] = pd.to_numeric(df[\"month\"]) #convert to number\n    df[\"value\"] = df[\"value\"].replace(['-'],0) #Replace values that have a '-' to a 0\n    df[\"value\"] = pd.to_numeric(df[\"value\"]) #convert to number\n    cols = list(df.columns.values)\n    df = df[['series_id', 'year', 'period', 'value', 'month', 'Category']] #order the columns in the dataframe\n    return df<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Invoke the cleaning function on the 3 dataframes\nhousehold_prices = data_cleaning(household_prices)\ngasoline_prices = data_cleaning(gasoline_prices)\nfood_prices = data_cleaning(food_prices)<\/code><\/pre>\n<\/div>\n<h3>Creating a Container structure in GridDB<\/h3>\n<p>Refer to <a href=\"https:\/\/griddb.net\/en\/blog\/griddb-webapi\/\">GridDB WebAPI<\/a> to know more about creating containers in GridDB.<\/p>\n<p>We will now proceed with creating a container in GridDB to hold the data.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">import requests  # to make http calls\nimport http\nhttp.client.HTTPConnection.debuglevel = 1 #Tip - to enable detailed logging of http calls; this is not needed in case you don't detailed logging<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Construct an object to hold the request headers (ensure that you replace the XXX placeholder with the correct value that matches the credentials for your GridDB instance)\nheader_obj = {\"Authorization\":\"XXX\",\"Content-Type\":\"application\/json; charset=UTF-8\",\"User-Agent\":\"PostmanRuntime\/7.29.0\"}\n\n#Construct the base URL based on your GRIDDB cluster you'd like to connect to (ensure that you replace the placeholders in the URL below with the correct values that correspond to your GridDB instance)\nbase_url = 'https:\/\/[host]:[port]\/griddb\/v2\/[clustername]\/dbs\/[database_name]'<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Construct an object to hold the request body (i.e., the container that needs to be created)\ndata_obj = {\n    \"container_name\": \"Inflation_CPI_Analysis\",\n    \"container_type\": \"COLLECTION\",\n    \"rowkey\": False,\n    \"columns\": [\n    {\n    \"name\": \"series_id\",\n    \"type\": \"STRING\"\n    },\n    {\n    \"name\": \"year\",\n    \"type\": \"INTEGER\"\n    },\n    {\n    \"name\": \"period\",\n    \"type\": \"STRING\"\n    },\n    {\n    \"name\": \"value\",\n    \"type\": \"FLOAT\"\n    },\n    {\n    \"name\": \"month\",\n    \"type\": \"INTEGER\"\n    },\n    {\n    \"name\": \"category\",\n    \"type\": \"STRING\"\n    }        \n    ]\n}\n\n#Set up the GridDB WebAPI URL\nurl = base_url + '\/containers'\n\n#Invoke the GridDB WebAPI with the headers and the request body\nx = requests.post(url, json = data_obj, headers = header_obj)<\/code><\/pre>\n<\/div>\n<p>The container that will store all the data has now been created in GridDB. Note that I set rowkey to False as the series_id field will not be unique as we have the same item occurring multiple times in the dataset (for each month and year).<\/p>\n<h2>Adding data to the container in GridDB\/Registering rows<\/h2>\n<h3>Loading Strategy: Creating Data Chunks<\/h3>\n<p>The below function converts a dataframe into a JSON object and then chunks it into lots of 1000 rows.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Setup the URL to be used to invoke the GridDB WebAPI to register rows in the container created previously\nurl = base_url + '\/containers\/Inflation_CPI_Analysis\/rows'\n\ndef create_chunks_to_load_to_GRIDDB(df):\n    list_of_dataframes = np.array_split(df, len(df)\/1000) #Returns a list of dataframes; here,# the chunk size is 1000\n    for i in list_of_dataframes:\n        df_json = i.to_json(orient='values')\n        request_body = df_json\n        x = requests.put(url, data=request_body, headers=header_obj) #Invoke the GridDB WebAPI using the request constructed\n        print(x.text)<\/code><\/pre>\n<\/div>\n<p>We will now load the 3 datasets that we have using the function that chunks the data and loads it into GridDB<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">create_chunks_to_load_to_GRIDDB(household_prices)<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">create_chunks_to_load_to_GRIDDB(food_prices)<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">create_chunks_to_load_to_GRIDDB(household_prices)<\/code><\/pre>\n<\/div>\n<h2>Quick Validation &amp; Introduction to TQL<\/h2>\n<p>Now that we&#8217;ve loaded data, we are good to proceed with the analysis. For the purpose of this analysis, we use GRIDDB&#8217;s query language called TQL. To know more on TQL, check out this <a href = \"https:\/\/griddb.net\/en\/blog\/griddb-query-language\/\"> resource <\/a>. There are also some Youtube video tutorials to grasp TQL quickly. Click <a href = \"https:\/\/www.youtube.com\/watch?v=-PCQUUimQEM\">here <\/a> for one such video tutorial. Follow the <a href = \"https:\/\/griddb.net\/en\/blog\/griddb-webapi\/\"> GridDB WebAPI guide <\/a> (Refer to the section &#8216;Fetching Data&#8217;) to learn the basic structure of a request for a TQL statement.<\/p>\n<p>The below TQL query does a quick check to see if the number of records inserted into GridDB is the same as the sum of the records in the 3 dataframes used for the data load.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Setup the URL to be used to invoke the GridDB WebAPI to retrieve data from the container\nurl = base_url + '\/tql'\n\n#Construct the request body which has the TQL that is to be used to retrieve the data\n#Use the count function to get the number of records in the container \nrequest_body = '[{\"name\":\"Inflation_CPI_Analysis\", \"stmt\":\"SELECT count(*) \", \"columns\":[]}]' \n\n\n#Invoke the GridDB WebAPI\nx = requests.post(url, data=request_body, headers=header_obj)<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">print(x.text)<\/code><\/pre>\n<\/div>\n<pre><code>[{\"columns\":[{\"name\":\"aggregationResult\",\"type\":\"DOUBLE\"}],\"results\":[[331879.0]]}]\n<\/code><\/pre>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">print(len(household_prices) + len(food_prices) + len(gasoline_prices))<\/code><\/pre>\n<\/div>\n<pre><code>331879\n<\/code><\/pre>\n<p>**<justify> \u00e2\u009c\u0085 &#8211; This confirms that all data loaded into the database has been successfuly loaded.<\/justify> **<\/p>\n<h1>Loading the mapping tables as dataframes<\/h1>\n<p>Below are the mapping files to be downloaded.<\/p>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-3.jpeg\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-3.jpeg\" alt=\"\" width=\"634\" height=\"303\" class=\"aligncenter size-full wp-image-28634\" srcset=\"\/wp-content\/uploads\/2022\/08\/download-3.jpeg 634w, \/wp-content\/uploads\/2022\/08\/download-3-300x143.jpeg 300w, \/wp-content\/uploads\/2022\/08\/download-3-600x287.jpeg 600w\" sizes=\"(max-width: 634px) 100vw, 634px\" \/><\/a><\/p>\n<p>** Note that all files are tab separated files. These mapping files can be used to lookup code descriptions if needed. These are going to remain in Python and not going to be loaded into GridDB.**<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">item_mapping = pd.read_csv('ap.item_mapping.txt',sep='t')\nperiod_mapping = pd.read_csv('ap.period_mapping.txt',sep='t')\nseasonal_mapping = pd.read_csv('ap.seasonal_mapping.txt',sep='t')\narea_mapping = pd.read_csv('ap.area_mapping.txt',sep='t')\nseries_mapping = pd.read_csv('ap.series_mapping.txt',sep='t')<\/code><\/pre>\n<\/div>\n<h1>Time Series Trends Analysis<\/h1>\n<h2>Scenario 1: How has inflation impacted the price of Rice?<\/h2>\n<p>** Writing a query to gather data for series_id APU0000701311 (Rice, white, long grain, precooked); APU0000701312 (Rice, white, long grain, uncooked). Note that each is of 1 pound weight. They are not seasonally adjusted. **<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Setup the URL to be used to invoke the GridDB WebAPI to retrieve data from the container\nurl = base_url + '\/tql'\n\n#Construct the request body which has the TQL that is to be used to retrieve the data\n# Getting data for series_id APU0000701311 (Rice, white, long grain, precooked); APU0000701312 (Rice, white, long grain, uncooked)\nrequest_body = '[{\"name\":\"Inflation_CPI_Analysis\", \"stmt\":\"SELECT * WHERE series_id = 'APU0000701311' OR series_id = 'APU0000701312'\", \"columns\":[]}]' \n\n#Invoke the GridDB WebAPI\ndata_req1 = requests.post(url, data=request_body, headers=header_obj)\ndata_req1<\/code><\/pre>\n<\/div>\n<p>We will process the response received from the GridDB WebAPI invocation and construct a dataframe with the data from the response.<br \/>\nOnce done, we will group the data by the year field so that we have the mean values for each year. This can then be plotted to see the trend in a visual manner.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Process the response received and construct a Pandas dataframe with the data from the response\nmyJson = data_req1.json()\nRice_trends = pd.DataFrame(myJson[0][\"results\"], columns=[myJson[0][\"columns\"][0][\"name\"], myJson[0][\"columns\"][1][\"name\"], myJson[0][\"columns\"][2][\"name\"], myJson[0][\"columns\"][3][\"name\"],myJson[0][\"columns\"][4][\"name\"],myJson[0][\"columns\"][5][\"name\"]])<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Group the data by year and get the mean for each year\nAvg_value_rice = pd.DataFrame(Rice_trends.groupby(['year'])['value'].mean())<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Construct a line plot with the data\nplt.rcParams[\"figure.figsize\"] = [12,12]\nplt.rcParams[\"figure.autolayout\"] = True\nax = sns.lineplot(x=\"year\", y=\"value\", data=Avg_value_rice)\nax.tick_params(rotation=45)\nax.set_title('Fig.1 Scenario 1 - Time Series Trends of Rice Prices', fontsize = 18)\nplt.xlabel('Year', fontsize=14)\nplt.ylabel('Average value ($ per pound)', fontsize=14)\nplt.show()<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download.png\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download.png\" alt=\"\" width=\"856\" height=\"856\" class=\"aligncenter size-full wp-image-28643\" srcset=\"\/wp-content\/uploads\/2022\/08\/download.png 856w, \/wp-content\/uploads\/2022\/08\/download-300x300.png 300w, \/wp-content\/uploads\/2022\/08\/download-150x150.png 150w, \/wp-content\/uploads\/2022\/08\/download-768x768.png 768w, \/wp-content\/uploads\/2022\/08\/download-230x230.png 230w, \/wp-content\/uploads\/2022\/08\/download-400x400.png 400w, \/wp-content\/uploads\/2022\/08\/download-600x600.png 600w, \/wp-content\/uploads\/2022\/08\/download-640x640.png 640w\" sizes=\"(max-width: 856px) 100vw, 856px\" \/><\/a><\/p>\n<h2>Insights for Scenario 1: Effect of Inflation on Rice<\/h2>\n<p>Based on the trend in Fig.1, the following insights are observed &#8211;<\/p>\n<ol>\n<li>After a sharp spike in the price of rice in the year 1980, the price of rice dropped by 0.4 units.<\/li>\n<li>In the year 1987 and 2003, the values seem to have dipped compared to the other years. <\/li>\n<li>In the year 1987, the values reached an all-time low.<\/li>\n<li>From the year 2020 onwards, we see a sharp spike in the price of rice from 0.75 units approaching towards 0.9 units.<\/li>\n<\/ol>\n<h2>Scenario 2: How has inflation impacted the price of poultry?<\/h2>\n<p>** Poultry includes all items that include chicken and eggs. Writing a query to gather data for series_id APU0200FF1101 (chicken breast with bone); APU0300FF1101 (chicken breast boneless); APU0300706111 (Chicken whole); APU0300706211 (Chicken breast); APU0300706212 (Chicken legs); APU0300708111 (Eggs). Note that as per the data, these items are non-seasonally adjusted. The prices are per pound (453.6 gm).**<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Setup the URL to be used to invoke the GridDB WebAPI to retrieve data from the container\nurl = base_url + '\/tql'\n\n#Construct the request body which has the TQL that is to be used to retrieve the data\n# Getting data for series_id APU0200FF1101 (chicken breast with bone); APU0300FF1101 (chicken breast boneless); APU0300706111 (Chicken whole); APU0300706211 (Chicken breast); APU0300706212 (Chicken legs); APU0300708111 (Eggs)\nrequest_body = '[{\"name\":\"Inflation_CPI_Analysis\", \"stmt\":\"SELECT * WHERE series_id = 'APU0200FF1101' OR series_id = 'APU0300FF1101' OR series_id = 'APU0300706111' OR series_id = 'APU0300706211' OR series_id = 'APU0300706212' OR series_id = 'APU0300708111' \", \"columns\":[]}]' \n\n#Invoke the GridDB WebAPI\ndata_req2 = requests.post(url, data=request_body, headers=header_obj)\ndata_req2<\/code><\/pre>\n<\/div>\n<p>We will process the response received from the GridDB WebAPI invocation and construct a dataframe with the data from the response.<br \/>\nOnce done, we will group the data by the year field so that we have the mean values for each year. This can then be plotted to see the trend in a visual manner.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Process the response received and construct a Pandas dataframe with the data from the response\nmyJson = data_req2.json()\nPoultry_trends = pd.DataFrame(myJson[0][\"results\"], columns=[myJson[0][\"columns\"][0][\"name\"], myJson[0][\"columns\"][1][\"name\"], myJson[0][\"columns\"][2][\"name\"], myJson[0][\"columns\"][3][\"name\"],myJson[0][\"columns\"][4][\"name\"],myJson[0][\"columns\"][5][\"name\"]])<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Group the data on a yearly basis and get the mean value for each year\nAvg_value_poultry = pd.DataFrame(Poultry_trends.groupby(['year'])['value'].mean())<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Construct a line plot with the data\nplt.rcParams[\"figure.figsize\"] = [12,12]\nplt.rcParams[\"figure.autolayout\"] = True\nax = sns.lineplot(x=\"year\", y=\"value\", data=Avg_value_poultry)\nax.tick_params(rotation=45)\nax.set_title('Fig.2 Scenario 2 - Time Series Trends of Poultry Prices',fontsize=18)\nplt.xlabel('Year', fontsize=14)\nplt.ylabel('Average value ($ per pound)', fontsize=14)\nplt.show()<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-1.png\" alt=\"\" width=\"856\" height=\"856\" class=\"aligncenter size-full wp-image-28641\" srcset=\"\/wp-content\/uploads\/2022\/08\/download-1.png 856w, \/wp-content\/uploads\/2022\/08\/download-1-300x300.png 300w, \/wp-content\/uploads\/2022\/08\/download-1-150x150.png 150w, \/wp-content\/uploads\/2022\/08\/download-1-768x768.png 768w, \/wp-content\/uploads\/2022\/08\/download-1-230x230.png 230w, \/wp-content\/uploads\/2022\/08\/download-1-400x400.png 400w, \/wp-content\/uploads\/2022\/08\/download-1-600x600.png 600w, \/wp-content\/uploads\/2022\/08\/download-1-640x640.png 640w\" sizes=\"(max-width: 856px) 100vw, 856px\" \/><\/a><\/p>\n<h2>Insights for Scenario 2: Effect of Inflation on Poultry<\/h2>\n<p>We have a very interesting trend here. Based on the trend in Fig.2, the following insights are observed &#8211;<\/p>\n<ol>\n<li>The average price of poultry was between 1.0 and 2.25 per pound between 1980 and 2005. However, from around 2006 onwards, the price rose to 2.25.<\/li>\n<li>After 2006, the price has risen to 2.25 and above.<\/li>\n<\/ol>\n<h2>Scenario 3: How has inflation impacted milk prices?<\/h2>\n<p>** The following series_ids are considered &#8211; APU0000709111 &#8211; Milk, fresh, whole, fortified; APU0000709211 &#8211; Milk, fresh, skim; APU0000709212 &#8211; Milk, fresh, low fat; APU0200709111 &#8211; Milk, fresh, whole, fortified; APU0200709211 &#8211; Milk, fresh, skim . Note that only items that are 1.5 gallons and that are not seasonally adjusted have been considered. **<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Setup the URL to be used to invoke the GridDB WebAPI to retrieve data from the container\nurl = base_url + '\/tql'\n\n#Construct the request body which has the TQL that is to be used to retrieve the data\n# Getting data for series_id APU0000709111 - Milk, fresh, whole, fortified; APU0000709211 - Milk, fresh, skim; APU0000709212 - Milk, fresh, low fat; APU0200709111 - Milk, fresh, whole, fortified; APU0200709211 - Milk, fresh, skim\nrequest_body = '[{\"name\":\"Inflation_CPI_Analysis\", \"stmt\":\"SELECT * WHERE series_id = 'APU0000709111' OR series_id = 'APU0000709211' OR series_id = 'APU0000709212' OR series_id = 'APU0200709111' OR series_id = 'APU0200709211' \", \"columns\":[]}]' \n\n#Invoke the GridDB WebAPI\ndata_req3 = requests.post(url, data=request_body, headers=header_obj)\ndata_req3<\/code><\/pre>\n<\/div>\n<p>We will process the response received from the GridDB WebAPI invocation and construct a dataframe with the data from the response.<br \/>\nOnce done, we will group the data by the year field so that we have the mean values for each year. This can then be plotted to see the trend in a visual manner.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Process the response received and construct a Pandas dataframe with the data from the response\nmyJson = data_req3.json()\nMilk_trends = pd.DataFrame(myJson[0][\"results\"], columns=[myJson[0][\"columns\"][0][\"name\"], myJson[0][\"columns\"][1][\"name\"], myJson[0][\"columns\"][2][\"name\"], myJson[0][\"columns\"][3][\"name\"],myJson[0][\"columns\"][4][\"name\"],myJson[0][\"columns\"][5][\"name\"]])<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Group the data by rear and get the mean value for each year\nAvg_value_milk = Milk_trends.groupby('year', as_index=False)['value'].mean()<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Construct a line plot with the data; ensure that the ticks on the x axis are integer values\nfrom matplotlib.ticker import MaxNLocator\n\nplt.rcParams[\"figure.figsize\"] = [12,12]\nplt.rcParams[\"figure.autolayout\"] = True\n#year = (Milk_trends['year'])\nax = sns.lineplot(x=\"year\", y=\"value\", data=Avg_value_milk)\nax.tick_params(rotation=45)\nax.set_title('Fig.3 Scenario 3 - Time Series Trends of Milk Prices',fontsize=18)\nax.xaxis.set_major_locator(MaxNLocator(integer=True))\nplt.xlabel('Year', fontsize=14)\nplt.ylabel('Average value ($ per pound)', fontsize=14)\nplt.show()<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-2.png\" alt=\"\" width=\"856\" height=\"856\" class=\"aligncenter size-full wp-image-28640\" srcset=\"\/wp-content\/uploads\/2022\/08\/download-2.png 856w, \/wp-content\/uploads\/2022\/08\/download-2-300x300.png 300w, \/wp-content\/uploads\/2022\/08\/download-2-150x150.png 150w, \/wp-content\/uploads\/2022\/08\/download-2-768x768.png 768w, \/wp-content\/uploads\/2022\/08\/download-2-230x230.png 230w, \/wp-content\/uploads\/2022\/08\/download-2-400x400.png 400w, \/wp-content\/uploads\/2022\/08\/download-2-600x600.png 600w, \/wp-content\/uploads\/2022\/08\/download-2-640x640.png 640w\" sizes=\"(max-width: 856px) 100vw, 856px\" \/><\/a><\/p>\n<h2>Insights for Scenario 3: Effect of Inflation on Milk<\/h2>\n<ol>\n<li>The average price of milk rose to about $1.5 per pound as of 1990.<\/li>\n<li>Between 1980 and 1986, the average price of milk was between $1 and $1.1.<\/li>\n<li>After 1990, the average price was always around $1.4<\/li>\n<\/ol>\n<h2>Scenario 4: How was 2022 in terms of inflation?<\/h2>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Setup the URL to be used to invoke the GridDB WebAPI to retrieve data from the container\nurl = base_url + '\/tql'\n\n#Construct the request body which has the TQL that is to be used to retrieve the data\n# Getting data for year 2022\nrequest_body = '[{\"name\":\"Inflation_CPI_Analysis\", \"stmt\":\"SELECT * WHERE year = 2022 \", \"columns\":[]}]' \n\n#Invoke the GridDB WebAPI\ndata_req4 = requests.post(url, data=request_body, headers=header_obj)\ndata_req4<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Process the response received and construct a Pandas dataframe with the data from the response\nmyJson = data_req4.json()\nyear_2022_trends = pd.DataFrame(myJson[0][\"results\"], columns=[myJson[0][\"columns\"][0][\"name\"], myJson[0][\"columns\"][1][\"name\"], myJson[0][\"columns\"][2][\"name\"], myJson[0][\"columns\"][3][\"name\"],myJson[0][\"columns\"][4][\"name\"],myJson[0][\"columns\"][5][\"name\"]])<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Construct a Seaborn lineplot with the data to display the trend lines for each category by month\nimport seaborn\nsns.lineplot('month', 'value', ci=None, hue='category', data=year_2022_trends).set(title='Fig.4 Scenario 4 - How was 2022 in terms of inflation?')\nplt.xlabel('Month (2022)', fontsize=14)\nplt.ylabel('Average value ($ per unit)', fontsize=14)\nplt.show()<\/code><\/pre>\n<\/div>\n<pre><code>C:Usersmg_suanaconda3libsite-packagesseaborn_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.\n  warnings.warn(\n<\/code><\/pre>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-3.png\" alt=\"\" width=\"712\" height=\"712\" class=\"aligncenter size-full wp-image-28639\" srcset=\"\/wp-content\/uploads\/2022\/08\/download-3.png 712w, \/wp-content\/uploads\/2022\/08\/download-3-300x300.png 300w, \/wp-content\/uploads\/2022\/08\/download-3-150x150.png 150w, \/wp-content\/uploads\/2022\/08\/download-3-230x230.png 230w, \/wp-content\/uploads\/2022\/08\/download-3-400x400.png 400w, \/wp-content\/uploads\/2022\/08\/download-3-600x600.png 600w, \/wp-content\/uploads\/2022\/08\/download-3-640x640.png 640w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><\/a><\/p>\n<h2>Insights for Scenario 4: 2022 &amp; Inflation<\/h2>\n<p>As of year 2022, 1. Prices of Gasoline seem to have been affected by inflation. 2. Prices of Household commodities and food have not been affected much by inflation.<br \/>\n3&#46; Prices of Gasoline have increased by $0.5 per unit as of February 2022. 4. Prices of Gasoline have increased by $1 per unit as of March 2022.<\/p>\n<h2>Scenario 5: Has there been a seasonality in the prices of gasoline in the last 20 years?<\/h2>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Setup the URL to be used to invoke the GridDB WebAPI to retrieve data from the container\nurl = base_url + '\/tql'\n\n#Construct the request body which has the TQL that is to be used to retrieve the data\n# Getting data for the 'Gasoline' category for the last 20 years\nrequest_body = '[{\"name\":\"Inflation_CPI_Analysis\", \"stmt\":\"SELECT * WHERE year >= 2001 and year &lt;= 2022 and category = 'Gasoline'\", \"columns\":[]}]' \n\n#Invoke the GridDB WebAPI\ndata_req5 = requests.post(url, data=request_body, headers=header_obj)\ndata_req5<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Process the response received and construct a Pandas dataframe with the data from the response\nmyJson = data_req5.json()\ngasoline_data_20_years = pd.DataFrame(myJson[0][\"results\"], columns=[myJson[0][\"columns\"][0][\"name\"], myJson[0][\"columns\"][1][\"name\"], myJson[0][\"columns\"][2][\"name\"], myJson[0][\"columns\"][3][\"name\"],myJson[0][\"columns\"][4][\"name\"],myJson[0][\"columns\"][5][\"name\"]])<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#Construct a boxplot of the year wise trends for the last 20 years\nfig, ax = plt.subplots(nrows=1, ncols=1, figsize=(15, 6))\nsns.boxplot(gasoline_data_20_years['year'], gasoline_data_20_years['value'], ax=ax)\nax.set_title('Fig.5 Scenario 5 - Year-wise trends', fontsize = 16, loc='center')\nax.set_xlabel('Year', fontsize = 12)\nax.set_ylabel('Value ($ per unit)', fontsize = 12)\nplt.xticks(rotation=45)<\/code><\/pre>\n<\/div>\n<pre><code>C:Usersmg_suanaconda3libsite-packagesseaborn_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.\n  warnings.warn(\n\n\n\n\n\n(array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,\n        17, 18, 19, 20, 21]),\n [Text(0, 0, '2001'),\n  Text(1, 0, '2002'),\n  Text(2, 0, '2003'),\n  Text(3, 0, '2004'),\n  Text(4, 0, '2005'),\n  Text(5, 0, '2006'),\n  Text(6, 0, '2007'),\n  Text(7, 0, '2008'),\n  Text(8, 0, '2009'),\n  Text(9, 0, '2010'),\n  Text(10, 0, '2011'),\n  Text(11, 0, '2012'),\n  Text(12, 0, '2013'),\n  Text(13, 0, '2014'),\n  Text(14, 0, '2015'),\n  Text(15, 0, '2016'),\n  Text(16, 0, '2017'),\n  Text(17, 0, '2018'),\n  Text(18, 0, '2019'),\n  Text(19, 0, '2020'),\n  Text(20, 0, '2021'),\n  Text(21, 0, '2022')])\n<\/code><\/pre>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-4.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/08\/download-4.png\" alt=\"\" width=\"1072\" height=\"424\" class=\"aligncenter size-full wp-image-28638\" srcset=\"\/wp-content\/uploads\/2022\/08\/download-4.png 1072w, \/wp-content\/uploads\/2022\/08\/download-4-300x119.png 300w, \/wp-content\/uploads\/2022\/08\/download-4-1024x405.png 1024w, \/wp-content\/uploads\/2022\/08\/download-4-768x304.png 768w, \/wp-content\/uploads\/2022\/08\/download-4-600x237.png 600w\" sizes=\"(max-width: 1072px) 100vw, 1072px\" \/><\/a><\/p>\n<h2>Insights for Scenario 5: Last 20 years of Inflation<\/h2>\n<ol>\n<li>No seasonality is observed in the inflation of gasoline prices.<\/li>\n<li>However, it is clearly evident that in 2022, inflation is at all time high.<\/li>\n<li>As seen from the plot, in 2008, the prices were high for majority of the year. However, there seems to have been a drastic decreases in the prices towards the end of the year. This is evident from the outliers in the box plot for 2008.<\/li>\n<li>Between 2019 and 2021, there have been several drastic spikes in gasoline prices as observed by the outliers beyond the upper whisker.<\/li>\n<\/ol>\n<h2>Concluding Remarks<\/h2>\n<p>In the above blog post, we used GridDB to store large amounts of data and used GridDB&#8217;s TQL query functionality to retrieve data in an efficient manner. Despite the size of the data, the data load was pretty quick (in seconds). The query times were also pretty minimal and results were retrieved in a couple of seconds. We were also able to demonstrate the ease of creating containers in GridDB and running queries against the containers in GridDB.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview In recent times, the popularity of the search terms &#8216;Inflation&#8217;, &#8216;Shortage&#8217;, &#8216;Food Prices&#8217; and &#8216;Gas Prices&#8217; have gone up by 100-140 % (Source: Google Trends). There&#8217;s no doubt that people all over the world are worried about food and gas prices going up. It goes without saying that sky-rocketing and inflated prices of commodities [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":28630,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46721","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Sky-rocketing Prices &amp; Inflation- An Analysis using GridDB and Python | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"Overview In recent times, the popularity of the search terms &#039;Inflation&#039;, &#039;Shortage&#039;, &#039;Food Prices&#039; and &#039;Gas Prices&#039; have gone up by 100-140 % (Source:\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sky-rocketing Prices &amp; Inflation- An Analysis using GridDB and Python | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"Overview In recent times, the popularity of the search terms &#039;Inflation&#039;, &#039;Shortage&#039;, &#039;Food Prices&#039; and &#039;Gas Prices&#039; have gone up by 100-140 % (Source:\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-07T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-13T20:56:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2022\/08\/download-scaled.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1701\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"griddb-admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"griddb-admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"19 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Sky-rocketing Prices &#038; Inflation- An Analysis using GridDB and Python\",\"datePublished\":\"2022-09-07T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:56:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/\"},\"wordCount\":1626,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2022\/08\/download-scaled.jpeg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/\",\"url\":\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/\",\"name\":\"Sky-rocketing Prices & Inflation- An Analysis using GridDB and Python | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2022\/08\/download-scaled.jpeg\",\"datePublished\":\"2022-09-07T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:56:13+00:00\",\"description\":\"Overview In recent times, the popularity of the search terms 'Inflation', 'Shortage', 'Food Prices' and 'Gas Prices' have gone up by 100-140 % (Source:\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2022\/08\/download-scaled.jpeg\",\"contentUrl\":\"\/wp-content\/uploads\/2022\/08\/download-scaled.jpeg\",\"width\":2560,\"height\":1701},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb.net\/en\/#website\",\"url\":\"https:\/\/griddb.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"caption\":\"griddb-admin\"},\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sky-rocketing Prices & Inflation- An Analysis using GridDB and Python | GridDB: Open Source Time Series Database for IoT","description":"Overview In recent times, the popularity of the search terms 'Inflation', 'Shortage', 'Food Prices' and 'Gas Prices' have gone up by 100-140 % (Source:","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/","og_locale":"en_US","og_type":"article","og_title":"Sky-rocketing Prices & Inflation- An Analysis using GridDB and Python | GridDB: Open Source Time Series Database for IoT","og_description":"Overview In recent times, the popularity of the search terms 'Inflation', 'Shortage', 'Food Prices' and 'Gas Prices' have gone up by 100-140 % (Source:","og_url":"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2022-09-07T07:00:00+00:00","article_modified_time":"2025-11-13T20:56:13+00:00","og_image":[{"width":2560,"height":1701,"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2022\/08\/download-scaled.jpeg","type":"image\/jpeg"}],"author":"griddb-admin","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"griddb-admin","Est. reading time":"19 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/"},"author":{"name":"griddb-admin","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Sky-rocketing Prices &#038; Inflation- An Analysis using GridDB and Python","datePublished":"2022-09-07T07:00:00+00:00","dateModified":"2025-11-13T20:56:13+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/"},"wordCount":1626,"commentCount":0,"publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2022\/08\/download-scaled.jpeg","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/","url":"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/","name":"Sky-rocketing Prices & Inflation- An Analysis using GridDB and Python | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2022\/08\/download-scaled.jpeg","datePublished":"2022-09-07T07:00:00+00:00","dateModified":"2025-11-13T20:56:13+00:00","description":"Overview In recent times, the popularity of the search terms 'Inflation', 'Shortage', 'Food Prices' and 'Gas Prices' have gone up by 100-140 % (Source:","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/blog\/sky-rocketing-prices-inflation-an-analysis-using-griddb-and-python\/#primaryimage","url":"\/wp-content\/uploads\/2022\/08\/download-scaled.jpeg","contentUrl":"\/wp-content\/uploads\/2022\/08\/download-scaled.jpeg","width":2560,"height":1701},{"@type":"WebSite","@id":"https:\/\/griddb.net\/en\/#website","url":"https:\/\/griddb.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","caption":"griddb-admin"},"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/46721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/comments?post=46721"}],"version-history":[{"count":1,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/46721\/revisions"}],"predecessor-version":[{"id":51393,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/46721\/revisions\/51393"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/media\/28630"}],"wp:attachment":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/media?parent=46721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/categories?post=46721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/tags?post=46721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}