{"id":46641,"date":"2021-04-22T00:00:00","date_gmt":"2021-04-22T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/using-pandas-dataframes-with-griddb\/"},"modified":"2025-11-13T12:55:18","modified_gmt":"2025-11-13T20:55:18","slug":"using-pandas-dataframes-with-griddb","status":"publish","type":"post","link":"https:\/\/griddb.net\/en\/blog\/using-pandas-dataframes-with-griddb\/","title":{"rendered":"Using Pandas Dataframes with GridDB"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Pandas Dataframes, as defined by their documentation, are data structures that are &#8220;Two-dimensional, size-mutable, potentially heterogeneous tabular data&#8221;. They essentially make performing data analysis quick and easy, allowing developers and data scientists to quickly perform experiments without having to write long blocks of code.<\/p>\n<p>In this blog post we will demonstrate basic reading and writing between GridDB and a Pandas Dataframe, as well as some often-used transformations which GridDB developers may find useful.<\/p>\n<h2>Reading Data<\/h2>\n<p>To read data from GridDB into a data frame, you simply set up your query as normal and instead of a while rs.has_next() loop, you simply call rs.fetch_rows() which returns the DataFrame for that result set as demonstrated in the following example:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">import datetime\nimport griddb_python as griddb\nimport sys\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nfactory = griddb.StoreFactory.get_instance()\n\nargv = sys.argv\n\ngridstore = factory.get_store(\n    host=\"239.0.0.1\",\n    port=31999,\n    cluster_name=\"defaultCluster\",\n    username=\"admin\",\n    password=\"admin\"\n)\n\ncol = gridstore.get_container(\"precinct_108\")\n\nstart = datetime.datetime.utcnow().timestamp() \nquery = col.query(\"select *\")\nrs = query.fetch(False)\nrows = rs.fetch_rows()\nrows['CMPLNT_FR'] = pd.to_datetime(rows['CMPLNT_FR'])\nprint(rows)\n\n<\/code><\/pre>\n<\/div>\n<h2>Writing Data<\/h2>\n<p>Writing data to GridDB from a dataframe is also a simple operation. Create your ContainerInfo object that contains the data schema, open the container and call put_rows() with your dataframe as the argument. One word of caution, your schema column order and the dataframe column order must match but it is simple to re-order the dataframe by simply specifying the correct column order in a list in the specification.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">conInfo = griddb.ContainerInfo(\"PANDAS_AGGS\",\n                [[\"key\", griddb.Type.STRING], \n                [\"timestamp\", griddb.Type.TIMESTAMP],\n                [\"precinct\", griddb.Type.INTEGER],\n                [\"count\", griddb.Type.INTEGER]],\n            griddb.ContainerType.COLLECTION, True)\n\naggcn = gridstore.put_container(conInfo)\naggcn.put_rows(df[[\"key\", \"timestamp\",\"precinct\",\"count\"]])\n<\/code><\/pre>\n<\/div>\n<h2>Simple Transformations<\/h2>\n<p>There are a many examples of simple operations you can performance with a Dataframe, but here are few:<\/p>\n<p>Setting the value of a column:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">df['precinct'] = 108\n<\/code><\/pre>\n<\/div>\n<p>Combining two different columns, the same can be used for finding the sum or difference of each row.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">df['key'] = df['CMPLNT_FR'].dt.strftime('%Y-%m-%d') +\"_\"+ df['precinct'].astype('str')\n<\/code><\/pre>\n<\/div>\n<p>Renaming a column:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">df = df.rename(columns={'CMPLNT_FR':'timestamp'})\n<\/code><\/pre>\n<\/div>\n<h2>Binning\/Bucketing<\/h2>\n<p>In our <a href=\"\">Time Series Forecasting tutorial<\/a>, we needed to transform individual complaints into the number of complaints reported per month. This required multiple nested for-loops. With Pandas Dataframes, we can accomplish the same thing with one line of code:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">monthly_df = rows.groupby([pd.Grouper(key='CMPLNT_FR',freq='M')]).size().reset_index(name='count')\n<\/code><\/pre>\n<\/div>\n<p>Now, at first glance the code is difficult to understand, the rows are split into groups defined by the input argument list, in this case every month that&#8217;s within the dataframe. The size of each of these groups is taken and put into the &#8216;count&#8217; column.<\/p>\n<p>It is often useful to also track event occurance by Day of the Week or Hour of the Day, in fact I often include a dayofweek and hourofday fields in schemas I build to easily query just data on Sundays or at 5pm. With a Pandas dataframe, both are just one liners.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">weekly_df = rows.groupby(rows['CMPLNT_FR'].dt.day_name()).size().reset_index(name='count')\nhourly_df  = rows.groupby(rows['CMPLNT_FR'].dt.hour).size().reset_index(name='count')\n<\/code><\/pre>\n<\/div>\n<h2>Performance<\/h2>\n<p>So what&#8217;s faster? Reading or writing to pyarrays or dataframes? What about binning?<\/p>\n<p>Well, Pandas Dataframes have a downside, they&#8217;re slower.<\/p>\n<p>We wrote a simple benchmark that writes and reads 10000 rows, writing a dataframe to GridDB is approximately 50% slower than multiputting the same data as a List of Lists.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">blob = bytearray([65, 66, 67, 68, 69, 70, 71, 72, 73, 74])\nconInfo = griddb.ContainerInfo(\"col01\",\n    [[\"name\", griddb.Type.STRING],\n    [\"status\", griddb.Type.BOOL],\n    [\"count\", griddb.Type.LONG],\n    [\"lob\", griddb.Type.BLOB]],\n    griddb.ContainerType.COLLECTION, True)\n\ni=0\nrows=[]\nwhile i &lt; 10000:\n    rows.append([str(uuid.uuid1()), False, random.randint(0, 1048576), blob])\n    i=i+1\n\ngridstore.drop_container(\"col01\")\nstart =  datetime.datetime.utcnow().timestamp()\ncol = gridstore.put_container(conInfo)\ncol.multi_put(rows)\nprint(\"multiput took \"+  str(datetime.datetime.utcnow().timestamp() - start) +\" seconds\")\n\n\ndf = pandas.DataFrame(rows, columns=[\"name\", \"status\", \"count\", \"lob\"])\n\ngridstore.drop_container(\"col01\")\nstart =  datetime.datetime.utcnow().timestamp()\ncol = gridstore.put_container(conInfo)\ncol.put_rows(df)\ncol.multi_put(rows)\nprint(\"putrows took \"+  str(datetime.datetime.utcnow().timestamp() - start) +\" seconds\")\n<\/code><\/pre>\n<\/div>\n<p>Reading the data back found that appending the result set to a pylist was about 25% faster than reading it directly into a dataframe; reading the list and then converting to a dataframe was 50% slower again.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">col = gridstore.get_container(\"col01\")\n\nstart =  datetime.datetime.utcnow().timestamp()\nquery = col.query(\"select *\")\nrs = query.fetch(False)\nresult = []\nwhile rs.has_next():\n    result.append(rs.next())\nprint(\"pylist append took \"+  str(datetime.datetime.utcnow().timestamp() - start) +\" seconds\")\n\n\nstart =  datetime.datetime.utcnow().timestamp()\nquery = col.query(\"select *\")\nrs = query.fetch(False)\nresult = rs.fetch_rows()\nprint(\"fetch_rows took \"+  str(datetime.datetime.utcnow().timestamp() - start) +\" seconds\")\n\n<\/code><\/pre>\n<\/div>\n<p>When it comes to the binning, it depends on the number of bins. With the following code, adjusting the number or size of the bins resulted in changing performance. Fewer bins means better performance meanwhile the dataframe performance did not change as much as bin size or count was adjusted.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">tqls=[]\ndt =  datetime.datetime(2000, 1, 1, 0, 0, 0)\nwhile dt &lt; datetime.datetime(2020, 1, 1, 0, 0):\n    start = int(dt.timestamp()*1000)\n    end = int((dt + relativedelta(months=+1)).timestamp()*1000)\n    query = \"select count(*) where CMPLNT_FR > TO_TIMESTAMP_MS(\"+str(start)+\")\"\n    query = query + \" AND CMPLNT_FR &lt; TO_TIMESTAMP_MS(\"+str(end)+\")\"\n    tqls.append([dt, query])\n    dt = dt + relativedelta(months=+1);\n\ncol = gridstore.get_container(\"precinct_108\")\nstart = datetime.datetime.utcnow().timestamp() \n\nfor tql in tqls:\n    q = col.query(tql[1])\n    rs = q.fetch(False)\n    if rs.has_next():\n        data = rs.next()\n        count = data.get(griddb.Type.LONG)\n        print([str(tql[0].timestamp()), count ])\nprint(\"forloop \"+  str(datetime.datetime.utcnow().timestamp() - start) +\" seconds\")\n<\/code><\/pre>\n<\/div>\n<h2>Plotting<\/h2>\n<p>Visualizing your dataframes is also easy with MatPlotLib. Here we plot a simple line graph of the monthly aggregates from 2006 onwards:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">monthly_df = monthly_df.set_index('timestamp')\nts = monthly_df['count']\nax = ts['2006':].plot()\nax.set_xlabel('Year')\nax.set_ylabel('Crime Complaints')\nax.set_xlabel('Year')\n<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/04\/monthly.png\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/04\/monthly.png\" alt=\"\" width=\"786\" height=\"540\" class=\"aligncenter size-full wp-image-27426\" srcset=\"\/wp-content\/uploads\/2021\/04\/monthly.png 786w, \/wp-content\/uploads\/2021\/04\/monthly-300x206.png 300w, \/wp-content\/uploads\/2021\/04\/monthly-768x528.png 768w, \/wp-content\/uploads\/2021\/04\/monthly-600x412.png 600w\" sizes=\"(max-width: 786px) 100vw, 786px\" \/><\/a><\/p>\n<p>Likewise, it also simple to show the daily distribution by the hour in which crimes were reported:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">ax = hourly_df.plot.bar()\nax.set_xlabel('Hour Of Day')\nax.set_ylabel('Crime Complaints')\nax.get_legend().remove()\nplt.show()\n<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/04\/hourly.png\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/04\/hourly.png\" alt=\"\" width=\"810\" height=\"560\" class=\"aligncenter size-full wp-image-27425\" srcset=\"\/wp-content\/uploads\/2021\/04\/hourly.png 810w, \/wp-content\/uploads\/2021\/04\/hourly-300x207.png 300w, \/wp-content\/uploads\/2021\/04\/hourly-768x531.png 768w, \/wp-content\/uploads\/2021\/04\/hourly-600x415.png 600w\" sizes=\"(max-width: 810px) 100vw, 810px\" \/><\/a><\/p>\n<p>Showing the weekly distribution is a bit trickier as the Days of Week are not in comparitive order but creating a dictionary with the correct order and setting the index by that dictionary solves the problem.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">order = ['Sunday', 'Monday', 'Tuesday', 'Wednesday','Thursday','Friday','Saturday']\nax = weekly_df.set_index('timestamp').loc[order].plot(kind='area')\nax.set_xlabel('Day Of Week')\nax.set_ylabel('Crime Complaints')\nplt.xticks(rotation=45)\nax.get_legend().remove()\nplt.show()\n<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/04\/daily.png\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/04\/daily.png\" alt=\"\" width=\"824\" height=\"640\" class=\"aligncenter size-full wp-image-27421\" srcset=\"\/wp-content\/uploads\/2021\/04\/daily.png 824w, \/wp-content\/uploads\/2021\/04\/daily-300x233.png 300w, \/wp-content\/uploads\/2021\/04\/daily-768x597.png 768w, \/wp-content\/uploads\/2021\/04\/daily-600x466.png 600w\" sizes=\"(max-width: 824px) 100vw, 824px\" \/><\/a><\/p>\n<h2>Conclusion<\/h2>\n<p>Pandas Dataframes are the perfect compliment to GridDB and can easily allow developers to quickly deploy data driven applications or, when combined with mathplotlib, gain new insights into their data without having to write tedious data transformations. What you trade for in raw read\/write speed from a database perspective, you are more than likely to make up in ease of development and coding speed simply because dataframes provide a much more flexible and simpler way to analyze your large data sets.<\/p>\n<p>The Jupyter Notebook used in this blog is available on the GridDB.net GitHub page <a href=\"https:\/\/github.com\/griddbnet\/Blogs\/blob\/main\/Using%20Pandas%20Dataframes%20with%20GridDB\/Pandas.ipynb\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Pandas Dataframes, as defined by their documentation, are data structures that are &#8220;Two-dimensional, size-mutable, potentially heterogeneous tabular data&#8221;. They essentially make performing data analysis quick and easy, allowing developers and data scientists to quickly perform experiments without having to write long blocks of code. In this blog post we will demonstrate basic reading and [&hellip;]<\/p>\n","protected":false},"author":71,"featured_media":27427,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46641","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>Using Pandas Dataframes with GridDB | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"Introduction Pandas Dataframes, as defined by their documentation, are data structures that are &quot;Two-dimensional, size-mutable, potentially heterogeneous\" \/>\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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Pandas Dataframes with GridDB | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"Introduction Pandas Dataframes, as defined by their documentation, are data structures that are &quot;Two-dimensional, size-mutable, potentially heterogeneous\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/\" \/>\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=\"2021-04-22T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-13T20:55:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/04\/ningyu-he-K22SK31G-QM-unsplash-1-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1707\" \/>\n\t<meta property=\"og:image:height\" content=\"2560\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Owen\" \/>\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=\"Owen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/\"},\"author\":{\"name\":\"Owen\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66\"},\"headline\":\"Using Pandas Dataframes with GridDB\",\"datePublished\":\"2021-04-22T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:55:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/\"},\"wordCount\":697,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2021\/04\/ningyu-he-K22SK31G-QM-unsplash-1-scaled.jpg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/\",\"name\":\"Using Pandas Dataframes with GridDB | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2021\/04\/ningyu-he-K22SK31G-QM-unsplash-1-scaled.jpg\",\"datePublished\":\"2021-04-22T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:55:18+00:00\",\"description\":\"Introduction Pandas Dataframes, as defined by their documentation, are data structures that are \\\"Two-dimensional, size-mutable, potentially heterogeneous\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2021\/04\/ningyu-he-K22SK31G-QM-unsplash-1-scaled.jpg\",\"contentUrl\":\"\/wp-content\/uploads\/2021\/04\/ningyu-he-K22SK31G-QM-unsplash-1-scaled.jpg\",\"width\":1707,\"height\":2560},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66\",\"name\":\"Owen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g\",\"caption\":\"Owen\"},\"url\":\"https:\/\/griddb.net\/en\/author\/owen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using Pandas Dataframes with GridDB | GridDB: Open Source Time Series Database for IoT","description":"Introduction Pandas Dataframes, as defined by their documentation, are data structures that are \"Two-dimensional, size-mutable, potentially heterogeneous","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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/","og_locale":"en_US","og_type":"article","og_title":"Using Pandas Dataframes with GridDB | GridDB: Open Source Time Series Database for IoT","og_description":"Introduction Pandas Dataframes, as defined by their documentation, are data structures that are \"Two-dimensional, size-mutable, potentially heterogeneous","og_url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2021-04-22T07:00:00+00:00","article_modified_time":"2025-11-13T20:55:18+00:00","og_image":[{"width":1707,"height":2560,"url":"https:\/\/griddb.net\/wp-content\/uploads\/2021\/04\/ningyu-he-K22SK31G-QM-unsplash-1-scaled.jpg","type":"image\/jpeg"}],"author":"Owen","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"Owen","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/#article","isPartOf":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/"},"author":{"name":"Owen","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66"},"headline":"Using Pandas Dataframes with GridDB","datePublished":"2021-04-22T07:00:00+00:00","dateModified":"2025-11-13T20:55:18+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/"},"wordCount":697,"commentCount":0,"publisher":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2021\/04\/ningyu-he-K22SK31G-QM-unsplash-1-scaled.jpg","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/","name":"Using Pandas Dataframes with GridDB | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/#primaryimage"},"image":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2021\/04\/ningyu-he-K22SK31G-QM-unsplash-1-scaled.jpg","datePublished":"2021-04-22T07:00:00+00:00","dateModified":"2025-11-13T20:55:18+00:00","description":"Introduction Pandas Dataframes, as defined by their documentation, are data structures that are \"Two-dimensional, size-mutable, potentially heterogeneous","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/using-pandas-dataframes-with-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2021\/04\/ningyu-he-K22SK31G-QM-unsplash-1-scaled.jpg","contentUrl":"\/wp-content\/uploads\/2021\/04\/ningyu-he-K22SK31G-QM-unsplash-1-scaled.jpg","width":1707,"height":2560},{"@type":"WebSite","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66","name":"Owen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g","caption":"Owen"},"url":"https:\/\/griddb.net\/en\/author\/owen\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts\/46641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/comments?post=46641"}],"version-history":[{"count":1,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts\/46641\/revisions"}],"predecessor-version":[{"id":51316,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts\/46641\/revisions\/51316"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/media\/27427"}],"wp:attachment":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/media?parent=46641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/categories?post=46641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/tags?post=46641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}