{"id":50718,"date":"2020-12-18T00:00:00","date_gmt":"2020-12-18T08:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/"},"modified":"2025-11-14T07:54:15","modified_gmt":"2025-11-14T15:54:15","slug":"making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook","status":"publish","type":"post","link":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/","title":{"rendered":"GridDB\u3068Jupyter Notebook\u3092\u4f7f\u3063\u3066\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b"},"content":{"rendered":"<h2 id=\"introduction-and-purpose\">\u6982\u8981\u3068\u76ee\u7684<\/h2>\n<h3 id=\"the-use-case\">\u4f7f\u7528\u4f8b<\/h3>\n<p>\u81ea\u5206\u304c\u8907\u5408\u30d3\u30eb\u306e\u30aa\u30fc\u30ca\u30fc\u3060\u3068\u3057\u307e\u3059\u3002\u96fb\u529b\u6d88\u8cbb\u91cf\u3092\u76e3\u8996\u3059\u308b\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u3092\u5efa\u7269\u306e\u3042\u3061\u3053\u3061\u306b\u8a2d\u7f6e\u3057\u3066\u3044\u3066\u3001\u5404\u88c5\u7f6e\u306f1\u5206\u9593\u306b2\u56de\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u96fb\u529b\u6d88\u8cbb\u91cf\u306e\u30c7\u30fc\u30bf\u306f\u30ad\u30ed\u30ef\u30c3\u30c8\u3067\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306f\u30a8\u30dd\u30c3\u30af\u79d2\u306e\u5f62\u5f0f\u3067\u4fdd\u5b58\u3055\u308c\u3001\u6bce\u6708IoT\u30d7\u30ed\u30d0\u30a4\u30c0\u304b\u3089CSV\u30d5\u30a1\u30a4\u30eb\u304c\u5c4a\u304d\u307e\u3059\u3002<\/p>\n<h3 id=\"objectives\">\u76ee\u7684<\/h3>\n<p>\u7701\u30a8\u30cd\u6848\u3092\u7acb\u6848\u3057\u305f\u3044\u3068\u3057\u307e\u3059\u3002\u305d\u308c\u306b\u306f\u307e\u305a\u3001<strong>\u96fb\u529b\u6d88\u8cbb\u91cf\u306e\u30d1\u30bf\u30fc\u30f3<\/strong>\u3092\u7279\u5b9a\u3059\u308b\u306e\u304c\u826f\u3044\u3067\u3057\u3087\u3046\u3002\u3064\u307e\u308a\u3001\u96fb\u529b\u304c\u3069\u306e\u3088\u3046\u306b\u6d88\u8cbb\u3055\u308c\u3066\u3044\u308b\u304b\u3001\u6d88\u8cbb\u91cf\u304c\u5c11\u306a\u3044\u6642\u9593\u5e2f\u306f\u3044\u3064\u304b\u3001\u96fb\u529b\u6d88\u8cbb\u91cf\u304c\u7279\u306b\u591a\u3044\u6642\u9593\u5e2f\u306f\u3044\u3064\u304b\u3001\u306a\u3069\u3067\u3059\u3002\u305d\u3053\u3067\u56de\u5e30\u5206\u6790\u306a\u3069\u306e\u9ad8\u5ea6\u306a\u65b9\u6cd5\u3092\u4f7f\u308f\u305a\u306b\u3001\u500b\u3005\u306e\u30c7\u30fc\u30bf\u3092\u53ef\u8996\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u628a\u63e1\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<h3 id=\"methods\">\u65b9\u6cd5<\/h3>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u62bd\u51fa\u3057\u305f\u751f\u30c7\u30fc\u30bf\u3092<strong>GridDB<\/strong>\u306b\u4fdd\u5b58\u3057\u3001Jupyter Notebook\u3067\u53ef\u8996\u5316\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002\u5f8c\u8005\u306f\u30c7\u30fc\u30bf\u306e\u30c8\u30ec\u30f3\u30c9\u3084\u30d1\u30bf\u30fc\u30f3\u3092\u8abf\u3079\u305f\u308a\u3001\u30ec\u30dd\u30fc\u30c8\u3092\u4f5c\u6210\u3057\u305f\u308a\u3059\u308b\u306e\u306b\u975e\u5e38\u306b\u4fbf\u5229\u3067\u3059\u3002Jupyter\u306b\u306f\u30b3\u30fc\u30c9\u30c1\u30e3\u30f3\u30af\u7528\u306e\u30bb\u30eb\u3001\u81ea\u5206\u306e\u8003\u3048\u3084\u30e1\u30e2\u306a\u3069\u3092\u66f8\u304d\u7559\u3081\u308b\u30b7\u30f3\u30d7\u30eb\u306a\u30c6\u30ad\u30b9\u30c8\u7528\u306e\u30bb\u30eb\u304c\u3042\u308a\u307e\u3059\u3002Jupyter Notebook\u306f\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\u3057\u3066\u7c21\u5358\u306b\u5206\u6790\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3001\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30c6\u30a3\u30b9\u30c8\u306e\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>Jupyter Notebook\u306f\u3059\u3079\u3066\u306ePython\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u52d5\u4f5c\u3057\u307e\u3059\u3002<\/p>\n<h3 id=\"prerequisites\">\u524d\u63d0\u6761\u4ef6<\/h3>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\u3001<a href=\"https:\/\/griddb.net\/ja\/blog\/using-python-to-interface-with-griddb-via-jdbc-with-jaydebeapi\/\">Jupyter\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057GridDB\u3078\u30a2\u30af\u30bb\u30b9\u3059\u308b\u65b9\u6cd5<\/a>\u3092\u8aac\u660e\u3057\u305fGridDB\u306e\u904e\u53bb\u306e\u30d6\u30ed\u30b0\u8a18\u4e8b\u3092\u57fa\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u59cb\u3081\u308b\u306b\u3042\u305f\u308a\u3001\u524d\u8ff0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u3069\u3061\u3089\u3082\u5b8c\u4e86\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2 id=\"saving-data-into-the-database\">\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b<\/h2>\n<p>\u516c\u958b\u3055\u308c\u3066\u3044\u308bIoT\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304b\u3089\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002<br \/>\n\u3053\u306e\u30c7\u30fc\u30bf\u306f\u3001<a href=\"https:\/\/combed.github.io\">\u5927\u5b66\u69cb\u5185\u306e\u96fb\u529b\u6d88\u8cbb\u91cf\u306e\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u306e\u30c7\u30fc\u30bf<\/a>\u3067\u3059\u3002<br \/>\n1\u304b\u6708\u5206\u306e\u8a0886192\u500b\u306e\u30c7\u30fc\u30bf\u304c\u3042\u308a\u3001\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u624b\u9806\u3092\u8aac\u660e\u3059\u308b\u306b\u306f\u5341\u5206\u306a\u91cf\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u5b9f\u969b\u306e\u4f5c\u696d\u306b\u3068\u308a\u304b\u304b\u308a\u307e\u3057\u3087\u3046<\/p>\n<h3 id=\"access-the-database\">\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b<\/h3>\n<p>\u307e\u305aJayDeBeApi Python\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4f7f\u3063\u3066\u3001\u3053\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\"><span class=\"hljs-keyword\">import<\/span> jaydebeapi\n\nconn = jaydebeapi.<span class=\"hljs-built_in\">connect<\/span>(<span class=\"hljs-string\">\"com.toshiba.mwcloud.gs.sql.Driver\"<\/span>,\n                           <span class=\"hljs-string\">\"jdbc:gs:\/\/griddb:20001\/defaultCluster\/public?notificationMember:127.0.0.1:20001\"<\/span>,\n                           [<span class=\"hljs-string\">\"admin\"<\/span>, <span class=\"hljs-string\">\"admin\"<\/span>],\n                          <span class=\"hljs-string\">\"\/usr\/share\/java\/gridstore-jdbc-4.5.0.jar\"<\/span>,)\ncurs = conn.<span class=\"hljs-built_in\">cursor<\/span>()\n<\/code><\/pre>\n<\/div>\n<h2 id=\"create-a-table\">\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u306e\u63a5\u7d9a\u304c\u78ba\u7acb\u3055\u308c\u3001\u30c7\u30fc\u30bf\u3092\u633f\u5165\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u30af\u30a8\u30ea\u306fSQL\u3067\u66f8\u304d\u307e\u3059\u3002<br \/>\n\u3053\u306e\u30af\u30a8\u30ea\u3092<code>curs.execute()<\/code>\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u9001\u4fe1\u3057\u307e\u3059\u3002<br \/>\n\u6700\u521d\u306e\u30af\u30a8\u30ea\u306f\u3001\u30c7\u30fc\u30bf\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u30af\u30a8\u30ea\u3067\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\">curs.execute('<span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> power2(<span class=\"hljs-keyword\">timestamp<\/span> <span class=\"hljs-built_in\">INTEGER<\/span>, <span class=\"hljs-keyword\">power<\/span> <span class=\"hljs-built_in\">FLOAT<\/span>)<span class=\"hljs-string\">')<\/span>\n<\/code><\/pre>\n<\/div>\n<h2 id=\"inserting-the-data\">\u30c7\u30fc\u30bf\u3092\u633f\u5165\u3059\u308b<\/h2>\n<p>\u30c7\u30fc\u30bf\u3092CSV\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<br \/>\nJupyter\u3092\u4f7f\u3063\u3066\u76f4\u63a5\u3001\u30c7\u30fc\u30bf\u3092\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306b\u4fdd\u5b58\u3057\u3001\u305d\u308c\u3092GriDB\u306b\u9001\u4fe1\u3067\u304d\u307e\u3059\u3002<br \/>\n\u5b9a\u671f\u7684\u306b\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u3001\u3053\u306e\u624b\u9806\u3092\u7e70\u308a\u8fd4\u3059\u3053\u3068\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u305f\u308a\u3001\u3053\u306e\u52d5\u4f5c\u3092\u81ea\u52d5\u5316\u3057\u305f\u308a\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code>info()<\/code>\u95a2\u6570\u3084<code>head()<\/code>\u95a2\u6570\u3092\u547c\u3073\u51fa\u3057\u3066\u7c21\u5358\u306a\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u306e\u306f\u3088\u3044\u7fd2\u6163\u3067\u3059\u3002\u305a\u3044\u3076\u3093\u982d\u75db\u306e\u7a2e\u3092\u6e1b\u3089\u305b\u308b\u3067\u3057\u3087\u3046\u3002<br \/>\n\u30c7\u30fc\u30bf\u306b\u30ae\u30e3\u30c3\u30d7\u3084\u304a\u304b\u3057\u306a\u7b87\u6240\u304c\u3042\u3063\u3066\u3082\u3001\u65e9\u671f\u306b\u6c17\u3065\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\"><span class=\"hljs-keyword\">import<\/span> pandas as pd\n\n<span class=\"hljs-keyword\">power<\/span> = pd.read_csv(<span class=\"hljs-string\">'Power.csv'<\/span>, names = [<span class=\"hljs-string\">'timestamp'<\/span>, <span class=\"hljs-string\">'power'<\/span>])\n<span class=\"hljs-keyword\">power<\/span>.info()\n<\/code><\/pre>\n<\/div>\n<pre><code>&lt;class 'pandas.core.frame.DataFrame'&gt;\nRangeIndex:<span class=\"hljs-number\"> 86192 <\/span>entries,<span class=\"hljs-number\"> 0 <\/span>to 86191\nData columns (total<span class=\"hljs-number\"> 2 <\/span>columns):\n <span class=\"hljs-comment\">#   Column     Non-Null Count  Dtype  <\/span>\n---  ------     --------------  -----  \n<span class=\"hljs-number\"> 0 <\/span>  timestamp <span class=\"hljs-number\"> 86192 <\/span>non-null  float64\n<span class=\"hljs-number\"> 1 <\/span>  power     <span class=\"hljs-number\"> 86192 <\/span>non-null  float64\ndtypes: float64(2)\nmemory usage: 1.3 MB\n<\/code><\/pre>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\">pd<span class=\"hljs-selector-class\">.options<\/span><span class=\"hljs-selector-class\">.display<\/span><span class=\"hljs-selector-class\">.float_format<\/span> = <span class=\"hljs-string\">'{:.2f}'<\/span><span class=\"hljs-selector-class\">.format<\/span>\npower.head()\n<\/code><\/pre>\n<\/div>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {<br \/>\n      vertical-align: middle;<br \/>\n    }<\/p>\n<p>    .dataframe tbody tr th {<br \/>\n      vertical-align: top;<br \/>\n    }<\/p>\n<p>    .dataframe thead th {<br \/>\n      text-align: right;<br \/>\n    }<br \/>\n  <\/style>\n<table class=\"dataframe\" border=\"1\">\n<thead>\n<tr style=\"text-align: right;\">\n<th><\/th>\n<th>timestamp<\/th>\n<th>power<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>0<\/th>\n<td>1401595223<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>1<\/th>\n<td>1401595253<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>2<\/th>\n<td>1401595283<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>3<\/th>\n<td>1401595313<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>4<\/th>\n<td>1401595343<\/td>\n<td>0.00<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u4eca\u306e\u6642\u70b9\u3067\u306f\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306e\u30ab\u30e9\u30e0\u306f\u610f\u5473\u3092\u306a\u3057\u307e\u305b\u3093\u3002<br \/>\n\u6700\u5f8c\u306b\u30bc\u30ed\u304c\uff13\u3064\u3042\u308a\u307e\u3059\u304c\u3001\u3072\u3087\u3063\u3068\u3057\u305f\u3089\u79d2\u306b\u52a0\u3048\u3066\u30df\u30ea\u79d2\u3082\u8a08\u6e2c\u3059\u308b\u306f\u305a\u306e\u3068\u3053\u308d\u3001\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u304c\u305d\u308c\u306b\u5931\u6557\u3057\u305f\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n\u4eca\u306e\u72b6\u614b\u3067\u306f\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u304c\u9577\u3059\u304e\u3066\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u66f8\u304d\u8fbc\u3081\u307e\u305b\u3093\u3002<br \/>\n\u305d\u308c\u306b\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u306f\u3001\u307b\u3068\u3093\u3069\u610f\u5473\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u30a8\u30dd\u30c3\u30af\u79d2\u306f\u6574\u6570\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u554f\u984c\u3092\u89e3\u6d88\u3057\u307e\u3057\u3087\u3046<\/p>\n<p>\u5225\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u8a66\u3057\u3066\u540c\u3058\u554f\u984c\u304c\u8d77\u304d\u306a\u3044\u5834\u5408\u3001\u3053\u306e\u624b\u9806\u306f\u30b9\u30ad\u30c3\u30d7\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u30dd\u30a4\u30f3\u30c8\u306f\u3001<strong>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u66f8\u304d\u8fbc\u3080\u524d\u306b\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306e\u5f62\u5f0f\u3092\u6574\u6570\u306b\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044<\/strong>\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\"><span class=\"hljs-built-in\">power<\/span>[<span class=\"hljs-string\">'timestamp'<\/span>] = (<span class=\"hljs-built-in\">power<\/span>[<span class=\"hljs-string\">'timestamp'<\/span>]\/<span class=\"hljs-number\">1000<\/span>).astype(int)\n<span class=\"hljs-built-in\">power<\/span>.info()\n<\/code><\/pre>\n<\/div>\n<pre><code>&lt;class 'pandas.core.frame.DataFrame'&gt;\nRangeIndex:<span class=\"hljs-number\"> 86192 <\/span>entries,<span class=\"hljs-number\"> 0 <\/span>to 86191\nData columns (total<span class=\"hljs-number\"> 2 <\/span>columns):\n <span class=\"hljs-comment\">#   Column     Non-Null Count  Dtype  <\/span>\n---  ------     --------------  -----  \n<span class=\"hljs-number\"> 0 <\/span>  timestamp <span class=\"hljs-number\"> 86192 <\/span>non-null  int64  \n<span class=\"hljs-number\"> 1 <\/span>  power     <span class=\"hljs-number\"> 86192 <\/span>non-null  float64\ndtypes: float64(1), int64(1)\nmemory usage: 1.3 MB\n<\/code><\/pre>\n<p>\u30c7\u30fc\u30bf\u306f\u6b63\u5e38\u306b\u8868\u793a\u3055\u308c\u3001\u3069\u3061\u3089\u306e\u578b\u3082\u3001\u4f5c\u6210\u3057\u305f\u8868\u306e\u30ab\u30e9\u30e0\u306e\u30c7\u30fc\u30bf\u578b\u3068\u4e00\u81f4\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3067\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u304b\u3089\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3059\u308b\u6e96\u5099\u304c\u6574\u3044\u307e\u3057\u305f\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\"><span class=\"hljs-keyword\">for<\/span> row <span class=\"hljs-keyword\">in<\/span> power.itertuples():\n    curs.execute(<span class=\"hljs-string\">'''\n                INSERT INTO power2 (timestamp, power)\n                VALUES (?,?)\n                '''<\/span>,\n                (row.timestamp, \n                row.power)\n                )\nconn.commit()\n<\/code><\/pre>\n<\/div>\n<p>\u30c7\u30fc\u30bf\u304c\u633f\u5165\u3055\u308c\u308b\u306e\u3092\u6211\u6162\u3057\u3066\u5f85\u3066\u3070\u3001\u3082\u3046\u4e00\u5ea6\u7c21\u5358\u306a\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u4f55\u304c\u8fd4\u3055\u308c\u308b\u304b\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u304b\u3089\u306f\u3001pandas\u30d1\u30c3\u30b1\u30fc\u30b8\u306e<code>read_sql_query()<\/code>\u95a2\u6570\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u3084\u308a\u3068\u308a\u3057\u307e\u3059\u3002<br \/>\n\u3053\u306e\u95a2\u6570\u304c\u3001\u30c7\u30fc\u30bf\u3092\u30d5\u30a7\u30c3\u30c1\u3057\u3066pandas\u306e\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306b\u5909\u63db\u3057\u307e\u3059\u3002<\/p>\n<h2 id=\"check-the-success\">\u6210\u529f\u3057\u305f\u304b\u78ba\u8a8d\u3059\u308b<\/h2>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\">sql = ('<span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">power<\/span>, <span class=\"hljs-keyword\">timestamp<\/span> <span class=\"hljs-keyword\">FROM<\/span> power2 <span class=\"hljs-keyword\">LiMIT<\/span> <span class=\"hljs-number\">1<\/span><span class=\"hljs-string\">')\nsql_query = pd.read_sql_query(sql, conn)\nsql_query<\/span>\n<\/code><\/pre>\n<\/div>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {<br \/>\n      vertical-align: middle;<br \/>\n    }<\/p>\n<p>    .dataframe tbody tr th {<br \/>\n      vertical-align: top;<br \/>\n    }<\/p>\n<p>    .dataframe thead th {<br \/>\n      text-align: right;<br \/>\n    }<br \/>\n  <\/style>\n<table class=\"dataframe\" border=\"1\">\n<thead>\n<tr style=\"text-align: right;\">\n<th><\/th>\n<th>power<\/th>\n<th>timestamp<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>0<\/th>\n<td>0.00<\/td>\n<td>1401595223<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u671f\u5f85\u3069\u304a\u308a\u306e\u30c7\u30fc\u30bf\u306e\u3088\u3046\u306a\u306e\u3067\u3001\u5f15\u304d\u7d9a\u304d\u3059\u3079\u3066\u306e\u884c\u3092\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\">sql = ('<span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">power<\/span>, <span class=\"hljs-keyword\">timestamp<\/span> <span class=\"hljs-keyword\">FROM<\/span> power2<span class=\"hljs-string\">')\nsql_query = pd.read_sql_query(sql, conn)\nsql_query.info()<\/span>\n<\/code><\/pre>\n<\/div>\n<pre><code>&lt;class 'pandas.core.frame.DataFrame'&gt;\nRangeIndex:<span class=\"hljs-number\"> 86192 <\/span>entries,<span class=\"hljs-number\"> 0 <\/span>to 86191\nData columns (total<span class=\"hljs-number\"> 2 <\/span>columns):\n <span class=\"hljs-comment\">#   Column     Non-Null Count  Dtype  <\/span>\n---  ------     --------------  -----  \n<span class=\"hljs-number\"> 0 <\/span>  power     <span class=\"hljs-number\"> 86192 <\/span>non-null  float64\n<span class=\"hljs-number\"> 1 <\/span>  timestamp <span class=\"hljs-number\"> 86192 <\/span>non-null  int64  \ndtypes: float64(1), int64(1)\nmemory usage: 1.3 MB\n<\/code><\/pre>\n<p>\u30ab\u30e9\u30e0\u306e\u5f62\u5f0f\u306f\u3001\u3069\u3061\u3089\u3082\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059\u3002<br \/>\n\u305d\u306e\u4e2d\u304b\u3089\u7570\u306a\u308b\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u30923\u3064\u4f5c\u6210\u3057\u3001\u96fb\u529b\u6d88\u8cbb\u91cf\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u628a\u63e1\u3057\u307e\u3059\u3002<br \/>\n\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3001\u30c7\u30fc\u30bf\u306e\u6e96\u5099\u306b\u9032\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n<h2 id=\"getting-first-insights\">\u6700\u521d\u306e\u8003\u5bdf<\/h2>\n<p>\u624b\u59cb\u3081\u306b\u3001\u3067\u304d\u308b\u304b\u304e\u308a\u7c21\u5358\u306a\u65b9\u6cd5\u3067\u30c7\u30fc\u30bf\u3092\u53ef\u8996\u5316\u3059\u308b\u306e\u306b\u6298\u308c\u7dda\u30b0\u30e9\u30d5\u3092\u4f7f\u3044\u307e\u3059\u3002<br \/>\n\u9ad8\u5ea6\u306a\u65b9\u6cd5\u3092\u884c\u3046\u524d\u306b\u3001\u30c7\u30fc\u30bf\u3092\u5e83\u3044\u8996\u70b9\u3067\u898b\u3066\u304a\u304f\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u3092\u30af\u30ed\u30fc\u30ba\u30a2\u30c3\u30d7\u3057\u305f\u308a\u3001\uff08\u73fe\u6642\u70b9\u3067\u30a2\u30a4\u30c7\u30a2\u3092\u6301\u3063\u3066\u3044\u307e\u305b\u3093\u304c\uff09\u7279\u5b9a\u306e\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u306b\u7126\u70b9\u3092\u5f53\u3066\u305f\u308a\u3001\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u691c\u7d22\u3057\u305f\u308a\u3059\u308b\u306a\u3069\u3001\u6b21\u306e\u624b\u9806\u3092\u8003\u3048\u308b\u4e0a\u3067\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<h3 id=\"small-preparations\">\u5c11\u3057\u6e96\u5099\u3059\u308b<\/h3>\n<p>\u30c7\u30fc\u30bf\u3092\u30d7\u30ed\u30c3\u30c8\u3059\u308b\u306b\u306f\u3001\u30a8\u30dd\u30c3\u30af\u79d2\u3092datetime\u5f62\u5f0f\u306b\u5909\u63db\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<br \/>\n\u305d\u3053\u304b\u3089\u6587\u5b57\u5217\u3092\u4f5c\u6210\u3057\u3001<code>to_datetime()<\/code> \u95a2\u6570\u3092\u9069\u7528\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\">sql_query[<span class=\"hljs-string\">'timestamp2'<\/span>] = sql_query[<span class=\"hljs-string\">'timestamp'<\/span>].apply<span class=\"hljs-comment\">(str)<\/span>\nsql_query.head<span class=\"hljs-comment\">()<\/span>\n<\/code><\/pre>\n<\/div>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {<br \/>\n      vertical-align: middle;<br \/>\n    }<\/p>\n<p>    .dataframe tbody tr th {<br \/>\n      vertical-align: top;<br \/>\n    }<\/p>\n<p>    .dataframe thead th {<br \/>\n      text-align: right;<br \/>\n    }<br \/>\n  <\/style>\n<table class=\"dataframe\" border=\"1\">\n<thead>\n<tr style=\"text-align: right;\">\n<th><\/th>\n<th>power<\/th>\n<th>timestamp<\/th>\n<th>timestamp2<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>0<\/th>\n<td>0.00<\/td>\n<td>1401595223<\/td>\n<td>1401595223<\/td>\n<\/tr>\n<tr>\n<th>1<\/th>\n<td>0.00<\/td>\n<td>1401595253<\/td>\n<td>1401595253<\/td>\n<\/tr>\n<tr>\n<th>2<\/th>\n<td>0.00<\/td>\n<td>1401595283<\/td>\n<td>1401595283<\/td>\n<\/tr>\n<tr>\n<th>3<\/th>\n<td>0.00<\/td>\n<td>1401595313<\/td>\n<td>1401595313<\/td>\n<\/tr>\n<tr>\n<th>4<\/th>\n<td>0.00<\/td>\n<td>1401595343<\/td>\n<td>1401595343<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\">sql_query[<span class=\"hljs-string\">'datetime'<\/span>] = sql_query[<span class=\"hljs-string\">'timestamp2'<\/span>].apply(lambda x: pd.to_datetime(x, unit=<span class=\"hljs-string\">'s'<\/span>))\n<\/code><\/pre>\n<pre><code class=\"lang-python\"><span class=\"hljs-selector-tag\">sql_query<\/span><span class=\"hljs-selector-class\">.head<\/span>()\n<\/code><\/pre>\n<\/div>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {<br \/>\n      vertical-align: middle;<br \/>\n    }<\/p>\n<p>    .dataframe tbody tr th {<br \/>\n      vertical-align: top;<br \/>\n    }<\/p>\n<p>    .dataframe thead th {<br \/>\n      text-align: right;<br \/>\n    }<br \/>\n  <\/style>\n<table class=\"dataframe\" border=\"1\">\n<thead>\n<tr style=\"text-align: right;\">\n<th><\/th>\n<th>power<\/th>\n<th>timestamp<\/th>\n<th>timestamp2<\/th>\n<th>datetime<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>0<\/th>\n<td>0.00<\/td>\n<td>1401595223<\/td>\n<td>1401595223<\/td>\n<td>2014-06-01 04:00:23<\/td>\n<\/tr>\n<tr>\n<th>1<\/th>\n<td>0.00<\/td>\n<td>1401595253<\/td>\n<td>1401595253<\/td>\n<td>2014-06-01 04:00:53<\/td>\n<\/tr>\n<tr>\n<th>2<\/th>\n<td>0.00<\/td>\n<td>1401595283<\/td>\n<td>1401595283<\/td>\n<td>2014-06-01 04:01:23<\/td>\n<\/tr>\n<tr>\n<th>3<\/th>\n<td>0.00<\/td>\n<td>1401595313<\/td>\n<td>1401595313<\/td>\n<td>2014-06-01 04:01:53<\/td>\n<\/tr>\n<tr>\n<th>4<\/th>\n<td>0.00<\/td>\n<td>1401595343<\/td>\n<td>1401595343<\/td>\n<td>2014-06-01 04:02:23<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u3053\u308c\u3067\u6700\u521d\u306e\u30b0\u30e9\u30d5\u3092\u4f5c\u6210\u3059\u308b\u6e96\u5099\u304c\u6574\u3044\u307e\u3057\u305f\u3002<\/p>\n<h2 id=\"line-chart-and-first-conclusions\">\u6298\u308c\u7dda\u30b0\u30e9\u30d5\u3068\u6700\u521d\u306e\u7d50\u8ad6<\/h2>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\">%matplotlib inline\nimport matplotlib.pyplot as plt\nplt.rcParams['figure.figsize'] = (20, 8) # Change the plot size\nsql_query.plot(y = 'power', x = 'datetime', grid=True)\n<\/code><\/pre>\n<\/div>\n<pre><code>&lt;<span class=\"hljs-string\">AxesSubplot:<\/span>xlabel=<span class=\"hljs-string\">'datetime'<\/span>&gt;\n<\/code><\/pre>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/12\/output_40_1.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-27139\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/12\/output_40_1.png\" alt=\"\" width=\"1162\" height=\"464\" srcset=\"\/wp-content\/uploads\/2020\/12\/output_40_1.png 1162w, \/wp-content\/uploads\/2020\/12\/output_40_1-300x120.png 300w, \/wp-content\/uploads\/2020\/12\/output_40_1-768x307.png 768w, \/wp-content\/uploads\/2020\/12\/output_40_1-1024x409.png 1024w, \/wp-content\/uploads\/2020\/12\/output_40_1-600x240.png 600w\" sizes=\"(max-width: 1162px) 100vw, 1162px\" \/><\/a><\/p>\n<p>\u3053\u306e\u30b0\u30e9\u30d5\u3092\u898b\u308b\u3068\u3001\u304b\u306a\u308a\u591a\u304f\u306e\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<br \/>\n\u96fb\u529b\u6d88\u8cbb\u304c\u7a81\u51fa\u3057\u3066\u3044\u308b\u7b87\u6240\u304c\u6570\u65e5\u3042\u308a\u307e\u3059\u304c\u3001\u305d\u308c\u3092\u9664\u3051\u3070\u96fb\u529b\u6d88\u8cbb\u91cf\u306f\u5e73\u5766\u306a\u30c8\u30ec\u30f3\u30c9\u3067\u3059\u3002<br \/>\n\u6bce\u65e5\u306e\u96fb\u529b\u6d88\u8cbb\u91cf\u306f\u4e00\u5b9a\u3067\u3001<strong>\u591c\u9593\u306f\u6e1b\u5c11\u3057\u3001\u9031\u672b\u306e2\u65e5\u9593\u306b\u30ae\u30e3\u30c3\u30d7\u304c\u3042\u308b<\/strong>\u3053\u3068\u304c\u8aad\u307f\u53d6\u308c\u307e\u3059\u3002<\/p>\n<p>\u663c\u591c\u3067\u5927\u304d\u306a\u9055\u3044\u306f\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002<br \/>\n\u65e5\u4e2d\u306f\u76f4\u7dda\u3067\u306f\u306a\u304f\u66f2\u7dda\u304c\u898b\u3089\u308c\u307e\u3059\u3002<br \/>\n\u3055\u3089\u306b\u63a8\u5bdf\u3067\u304d\u308b\u3053\u3068\u3068\u3057\u3066\u3001\u591c\u9593\u306e\u96fb\u529b\u6d88\u8cbb\u91cf\u304c\u5e38\u306b\u30bc\u30ed\u306b\u306a\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u51b7\u6696\u623f\u30b7\u30b9\u30c6\u30e0\u304c\u3042\u308a\u307e\u3059\u3002\u6d88\u8cbb\u91cf\u306f\u6c17\u6e29\u306b\u5927\u304d\u304f\u5de6\u53f3\u3055\u308c\u308b\u306e\u3067\u3001\u6bce\u65e5\u540c\u3058\u3068\u3044\u3046\u3053\u3068\u306f\u3042\u308a\u5f97\u307e\u305b\u3093\u3002<br \/>\n\u3053\u306e\u30b0\u30e9\u30d5\u304b\u3089\u307e\u3060\u4ed6\u306b<strong>\u30d1\u30bf\u30fc\u30f3<\/strong>\u3092\u898b\u3064\u3051\u3089\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u3082\u3063\u3068\u9ad8\u5ea6\u306a\u30b0\u30e9\u30d5\u306b\u9032\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2 id=\"finding-patterns\">\u30d1\u30bf\u30fc\u30f3\u3092\u898b\u3064\u3051\u308b<\/h2>\n<h3 id=\"rolling-mean\">\u79fb\u52d5\u5e73\u5747<\/h3>\n<p>\u591c\u9593\u306e\u30ae\u30e3\u30c3\u30d7\u304c\u3042\u308b\u305f\u3081\u3001\u6bce\u65e5\u306e\u30d4\u30fc\u30af\u6642\u306e\u6d88\u8cbb\u91cf\u304c\u300c\u5e73\u5766\u300d\u306b\u898b\u3048\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u65e5\u3005\u306e\u6570\u5024\u306e\u76f8\u9055\u70b9\u3092\u7279\u5b9a\u3057\u3001\u30c8\u30ec\u30f3\u30c9\u3092\u898b\u3064\u3051\u305f\u3044\u3067\u3059\u3002<br \/>\n\u305d\u3053\u3067\u79fb\u52d5\u5e73\u5747\u3092\u8ffd\u52a0\u3057\u3066\u3001\u7dda\u3092\u3055\u3089\u306b\u5e73\u5766\u306b\u3057\u307e\u3059\u3002<br \/>\n24\u6642\u9593\u3054\u3068\u306e\u6d88\u8cbb\u91cf\u306e\u5e73\u5747\u30c7\u30fc\u30bf\u3092\u7b97\u51fa\u3057\u30011\u65e5\u306e\u4e2d\u3067\u4efb\u610f\u306e\u6642\u70b9\u306b\u5272\u308a\u5f53\u3066\u307e\u3059\u3002<\/p>\n<p>\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306f30\u79d2\u3054\u3068\u306b\u4f5c\u6210\u3055\u308c\u308b\u8a2d\u5b9a\u306a\u306e\u3067\u300130\u79d2\u306860\u79d2\u5730\u70b9\u306e24\u6642\u9593\u5206\u30672880\u884c\u306e\u30c7\u30fc\u30bf\u304b\u3089\u5e73\u5747\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305frolling window\u306f\u3001\u30b0\u30e9\u30d5\u69cb\u7bc9\u306b\u5fc5\u8981\u306adatetime\u30ab\u30e9\u30e0\u306a\u3069\u306e\u4ed6\u306e\u30ab\u30e9\u30e0\u3092\u58ca\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8a2d\u5b9a\u3057\u3066\u304b\u3089\u30ea\u30bb\u30c3\u30c8\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\"><span class=\"hljs-attr\">timeseriesdf<\/span> = sql_query.drop(<span class=\"hljs-attr\">columns<\/span> = ['timestamp', 'timestamp2' ])\n<span class=\"hljs-attr\">timeseriesdf<\/span> = timeseriesdf.set_index('datetime')\n<span class=\"hljs-attr\">timeseriesdf<\/span> = timeseriesdf.rolling(<span class=\"hljs-number\">2880<\/span>).mean()\ntimeseriesdf.reset_index(<span class=\"hljs-attr\">inplace=True)<\/span>\ntimeseriesdf.tail()\n<\/code><\/pre>\n<\/div>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {<br \/>\n      vertical-align: middle;<br \/>\n    }<\/p>\n<p>    .dataframe tbody tr th {<br \/>\n      vertical-align: top;<br \/>\n    }<\/p>\n<p>    .dataframe thead th {<br \/>\n      text-align: right;<br \/>\n    }<br \/>\n  <\/style>\n<table class=\"dataframe\" border=\"1\">\n<thead>\n<tr style=\"text-align: right;\">\n<th><\/th>\n<th>datetime<\/th>\n<th>power<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>86187<\/th>\n<td>2014-07-01 03:57:47<\/td>\n<td>1210.53<\/td>\n<\/tr>\n<tr>\n<th>86188<\/th>\n<td>2014-07-01 03:58:17<\/td>\n<td>1210.52<\/td>\n<\/tr>\n<tr>\n<th>86189<\/th>\n<td>2014-07-01 03:58:47<\/td>\n<td>1210.54<\/td>\n<\/tr>\n<tr>\n<th>86190<\/th>\n<td>2014-07-01 03:59:17<\/td>\n<td>1210.53<\/td>\n<\/tr>\n<tr>\n<th>86191<\/th>\n<td>2014-07-01 03:59:47<\/td>\n<td>1210.53<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>2\u3064\u76ee\u306e\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u3092\u6e96\u5099\u3067\u304d\u305f\u3089\u3001\u5e73\u5747\u30c7\u30fc\u30bf\u3092\u30d7\u30ed\u30c3\u30c8\u3057\u3001\u751f\u30c7\u30fc\u30bf\u306e\u4e0a\u306b\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\">ax = sql_query.plot(y = <span class=\"hljs-string\">'power'<\/span>, ylabel = <span class=\"hljs-string\">'power'<\/span>, x = <span class=\"hljs-string\">'datetime'<\/span>, grid=True, <span class=\"hljs-keyword\">label<\/span><span class=\"bash\"> = <span class=\"hljs-string\">\"raw power data\"<\/span>)\n<\/span>timeseriesdf.plot(ax = ax, y = <span class=\"hljs-string\">'power'<\/span>, x = <span class=\"hljs-string\">'datetime'<\/span>, <span class=\"hljs-keyword\">label<\/span><span class=\"bash\"> = <span class=\"hljs-string\">\"rolling mean\"<\/span>)<\/span>\n<\/code><\/pre>\n<pre><code>&lt;<span class=\"hljs-string\">AxesSubplot:<\/span>xlabel=<span class=\"hljs-string\">'datetime'<\/span>, ylabel=<span class=\"hljs-string\">'power'<\/span>&gt;\n<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/12\/output_47_1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27138\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/12\/output_47_1.png\" alt=\"\" width=\"1176\" height=\"464\" srcset=\"\/wp-content\/uploads\/2020\/12\/output_47_1.png 1176w, \/wp-content\/uploads\/2020\/12\/output_47_1-300x118.png 300w, \/wp-content\/uploads\/2020\/12\/output_47_1-768x303.png 768w, \/wp-content\/uploads\/2020\/12\/output_47_1-1024x404.png 1024w, \/wp-content\/uploads\/2020\/12\/output_47_1-600x237.png 600w\" sizes=\"(max-width: 1176px) 100vw, 1176px\" \/><\/a><\/p>\n<p>\u3053\u308c\u3067\u6bce\u65e5\u306e\u6d88\u8cbb\u91cf\u304c\u540c\u3058\u3067\u306f\u306a\u3044\u3068\u308f\u304b\u308a\u307e\u3059\u3002<br \/>\n\u4f8b\u306b\u3088\u3063\u3066\u9031\u672b\u306b\u306f\u30ae\u30e3\u30c3\u30d7\u304c\u898b\u3089\u308c\u3001\u7d9a\u3044\u3066\u6d88\u8cbb\u91cf\u304c\u5c11\u3057\u305a\u3064\u5897\u52a0\u3057\u3066\u706b\u66dc\u65e5\u306b\u30d4\u30fc\u30af\u3092\u8fce\u3048\u307e\u3059\u3002<br \/>\n\u30d4\u30fc\u30af\u304c\u706b\u66dc\u65e5\u3067\u306f\u306a\u3044\u9031\u304c1\u9031\u3042\u308a\u307e\u3059\u304c\u3001\u305d\u306e\u6642\u306f\u9031\u672b\u306b\u96fb\u529b\u6d88\u8cbb\u91cf\u304c\u7a81\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3 id=\"heat-map\">\u30d2\u30fc\u30c8\u30de\u30c3\u30d7<\/h3>\n<p>\u6642\u9593\u5e2f\u3084\u66dc\u65e5\u306b\u3088\u308b\u96fb\u529b\u6d88\u8cbb\u306e\u30d1\u30bf\u30fc\u30f3\u304c\u6f20\u7136\u3068\u3064\u304b\u3081\u3066\u304d\u305f\u306e\u3067\u3001\u3053\u306e\u65b9\u5411\u3067\u3082\u3063\u3068\u6398\u308a\u4e0b\u3052\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u6298\u308c\u7dda\u30b0\u30e9\u30d5\u304b\u3089\u5f97\u3089\u308c\u308b\u3082\u306e\u306f\u3082\u3046\u306a\u3044\u306e\u3067\u3001\u30c7\u30fc\u30bf\u96c6\u8a08\u3057\u3066\u30d2\u30fc\u30c8\u30de\u30c3\u30d7\u306b\u5207\u308a\u66ff\u3048\u307e\u3059\u3002\u30d2\u30fc\u30c8\u30de\u30c3\u30d7\u306f\u96fb\u529b\u6d88\u8cbb\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u306b\u9069\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u3002<br \/>\n\u3053\u306e\u5efa\u7269\u3067\u96fb\u529b\u304c\u3069\u306e\u304f\u3089\u3044\u6d88\u8cbb\u3055\u308c\u3066\u3044\u308b\u304b\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3 id=\"preparing-the-aggregation-dimensions\">\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u96c6\u8a08\u306e\u6e96\u5099<\/h3>\n<p>\u30c7\u30fc\u30bf\u3092\u96c6\u8a08\u3059\u308b\u305f\u3081\u3001\u6b21\u306e2\u3064\u306e\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u6642<\/li>\n<li>\u66dc\u65e5<\/li>\n<\/ul>\n<p>\u76f4\u63a5datetime\u30ab\u30e9\u30e0\u304b\u3089\u6642\u3092\u62bd\u51fa\u3067\u304d\u307e\u3059\u3002<br \/>\n10\u672a\u6e80\u306e\u6642\u306b\u306f\u300c0\u300d\u3092\u8db3\u3057\u3066\u3001\u3042\u3068\u3067\u30ab\u30e9\u30e0\u3092\u30bd\u30fc\u30c8\u3057\u305f\u5834\u5408\u306b\u304d\u3061\u3093\u3068\u4e26\u3076\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u5e73\u65e5\u30c7\u30fc\u30bf\u306e\u53d6\u5f97\u306b\u306f\u5c11\u3057\u6e96\u5099\u304c\u5fc5\u8981\u3067\u3059\u3002datetime\u3092date\u306b\u5909\u63db\u3057\u3066\u304b\u3089\u66dc\u65e5\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002<br \/>\n\u8aad\u307f\u3084\u3059\u3044\u3088\u3046\u5e73\u65e5\u306b\u540d\u524d\u3082\u3064\u3051\u307e\u3059\u3002\u6700\u5f8c\u306b\u5c0f\u3055\u306a\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u3092\u4f5c\u6210\u3057\u3001\u30e1\u30a4\u30f3\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u3068\u30de\u30fc\u30b8\u3057\u307e\u3059\u3002<\/p>\n<h4 id=\"hour-of-the-day\">\u6642<\/h4>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\">sql_query[<span class=\"hljs-string\">'hour'<\/span>] = sql_query[<span class=\"hljs-string\">'datetime'<\/span>].apply(lambda x: <span class=\"hljs-string\">\"0\"<\/span> + <span class=\"hljs-built_in\">str<\/span>(x.<span class=\"hljs-built_in\">hour<\/span>) <span class=\"hljs-keyword\">if<\/span> x.<span class=\"hljs-built_in\">hour<\/span> &lt; <span class=\"hljs-number\">10<\/span> <span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-built_in\">str<\/span>(x.<span class=\"hljs-built_in\">hour<\/span>))\nsql_query.head()\n<\/code><\/pre>\n<\/div>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {<br \/>\n      vertical-align: middle;<br \/>\n    }<\/p>\n<p>    .dataframe tbody tr th {<br \/>\n      vertical-align: top;<br \/>\n    }<\/p>\n<p>    .dataframe thead th {<br \/>\n      text-align: right;<br \/>\n    }<br \/>\n  <\/style>\n<table class=\"dataframe\" border=\"1\">\n<thead>\n<tr style=\"text-align: right;\">\n<th><\/th>\n<th>power<\/th>\n<th>timestamp<\/th>\n<th>timestamp2<\/th>\n<th>datetime<\/th>\n<th>hour<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>0<\/th>\n<td>0.00<\/td>\n<td>1401595223<\/td>\n<td>1401595223<\/td>\n<td>2014-06-01 04:00:23<\/td>\n<td>04<\/td>\n<\/tr>\n<tr>\n<th>1<\/th>\n<td>0.00<\/td>\n<td>1401595253<\/td>\n<td>1401595253<\/td>\n<td>2014-06-01 04:00:53<\/td>\n<td>04<\/td>\n<\/tr>\n<tr>\n<th>2<\/th>\n<td>0.00<\/td>\n<td>1401595283<\/td>\n<td>1401595283<\/td>\n<td>2014-06-01 04:01:23<\/td>\n<td>04<\/td>\n<\/tr>\n<tr>\n<th>3<\/th>\n<td>0.00<\/td>\n<td>1401595313<\/td>\n<td>1401595313<\/td>\n<td>2014-06-01 04:01:53<\/td>\n<td>04<\/td>\n<\/tr>\n<tr>\n<th>4<\/th>\n<td>0.00<\/td>\n<td>1401595343<\/td>\n<td>1401595343<\/td>\n<td>2014-06-01 04:02:23<\/td>\n<td>04<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4 id=\"day-of-week\">\u66dc\u65e5<\/h4>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\">import datetime\nsql_query[<span class=\"hljs-string\">'date'<\/span>] = sql_query[<span class=\"hljs-string\">'datetime'<\/span>].apply(lambda x: datetime<span class=\"hljs-selector-class\">.datetime<\/span><span class=\"hljs-selector-class\">.date<\/span>(x))\nsql_query[<span class=\"hljs-string\">'weekday'<\/span>] = sql_query[<span class=\"hljs-string\">'date'<\/span>].apply(lambda x: str(datetime<span class=\"hljs-selector-class\">.datetime<\/span><span class=\"hljs-selector-class\">.weekday<\/span>(x)))\n<\/code><\/pre>\n<pre><code class=\"lang-python\"><span class=\"hljs-attr\">weekdaydf<\/span> = pd.DataFrame({<span class=\"hljs-string\">'day_of_week'<\/span>: [<span class=\"hljs-string\">\"Mon\"<\/span>, <span class=\"hljs-string\">\"Tue\"<\/span>, <span class=\"hljs-string\">\"Wed\"<\/span>, <span class=\"hljs-string\">\"Thu\"<\/span>, <span class=\"hljs-string\">\"Fr\"<\/span>, <span class=\"hljs-string\">\"Sat\"<\/span>, <span class=\"hljs-string\">\"Sun\"<\/span>], <span class=\"hljs-string\">'weekday'<\/span>:[<span class=\"hljs-string\">\"0\"<\/span>, <span class=\"hljs-string\">\"1\"<\/span>, <span class=\"hljs-string\">\"2\"<\/span>, <span class=\"hljs-string\">\"3\"<\/span>, <span class=\"hljs-string\">\"4\"<\/span>, <span class=\"hljs-string\">\"5\"<\/span>, <span class=\"hljs-string\">\"6\"<\/span>]})\n<span class=\"hljs-attr\">power<\/span> = pd.merge(sql_query, weekdaydf, <span class=\"hljs-literal\">on<\/span>=<span class=\"hljs-string\">'weekday'<\/span>)\n<span class=\"hljs-attr\">power<\/span> = power.drop(columns=[<span class=\"hljs-string\">'timestamp'<\/span>, <span class=\"hljs-string\">'timestamp2'<\/span>, <span class=\"hljs-string\">'datetime'<\/span>, <span class=\"hljs-string\">'date'<\/span>, <span class=\"hljs-string\">'weekday'<\/span>])\n<\/code><\/pre>\n<\/div>\n<h4 id=\"group-and-aggregate\">\u30b0\u30eb\u30fc\u30d7\u5316\u3068\u96c6\u8a08<\/h4>\n<p>\u30d2\u30fc\u30c8\u30de\u30c3\u30d7\u69cb\u7bc9\u306b\u4f7f\u3046\u96c6\u8a08\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u30012\u3064\u306e\u624b\u9806\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u3092groupby ()\u95a2\u6570\u3068sum ()\u95a2\u6570\u3067\u30b0\u30eb\u30fc\u30d7\u5316\u3057\u3066<\/li>\n<li>\u30d4\u30dc\u30c3\u30c8\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059<\/li>\n<\/ul>\n<p>\u3053\u308c\u3068\u306f\u5225\u306b\u3001\u5e73\u65e5\u3092\u30bd\u30fc\u30c8\u3059\u308b\u305f\u3081\u6b63\u3057\u3044\u9806\u5e8f\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\">powergrouped = power.groupby([<span class=\"hljs-string\">'day_of_week'<\/span>, <span class=\"hljs-string\">'hour'<\/span>], as_index=False).sum()\npowerpivot = powergrouped.pivot(<span class=\"hljs-string\">'day_of_week'<\/span>,<span class=\"hljs-string\">'hour'<\/span>, <span class=\"hljs-string\">'power'<\/span>)\n<span class=\"hljs-keyword\">new<\/span><span class=\"hljs-type\">_order<\/span>= [<span class=\"hljs-string\">\"Sun\"<\/span>, <span class=\"hljs-string\">\"Sat\"<\/span>, <span class=\"hljs-string\">\"Fr\"<\/span>, <span class=\"hljs-string\">\"Thu\"<\/span>, <span class=\"hljs-string\">\"Wed\"<\/span>, <span class=\"hljs-string\">\"Tue\"<\/span>, <span class=\"hljs-string\">\"Mon\"<\/span>]\npowerpivot.sort_index(axis=<span class=\"hljs-number\">1<\/span>, ascending=True, inplace=True) <span class=\"hljs-meta\">#x-axis<\/span>\npowerpivot = powerpivot.reindex(<span class=\"hljs-keyword\">new<\/span><span class=\"hljs-type\">_order<\/span>, axis=<span class=\"hljs-number\">0<\/span>)\n<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\"><span class=\"hljs-attribute\">powergrouped<\/span>\n<\/code><\/pre>\n<\/div>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {<br \/>\n      vertical-align: middle;<br \/>\n    }<\/p>\n<p>    .dataframe tbody tr th {<br \/>\n      vertical-align: top;<br \/>\n    }<\/p>\n<p>    .dataframe thead th {<br \/>\n      text-align: right;<br \/>\n    }<br \/>\n  <\/style>\n<table class=\"dataframe\" border=\"1\">\n<thead>\n<tr style=\"text-align: right;\">\n<th><\/th>\n<th>day_of_week<\/th>\n<th>hour<\/th>\n<th>power<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>0<\/th>\n<td>Fr<\/td>\n<td>00<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>1<\/th>\n<td>Fr<\/td>\n<td>01<\/td>\n<td>224969.23<\/td>\n<\/tr>\n<tr>\n<th>2<\/th>\n<td>Fr<\/td>\n<td>02<\/td>\n<td>864557.15<\/td>\n<\/tr>\n<tr>\n<th>3<\/th>\n<td>Fr<\/td>\n<td>03<\/td>\n<td>1119128.11<\/td>\n<\/tr>\n<tr>\n<th>4<\/th>\n<td>Fr<\/td>\n<td>04<\/td>\n<td>1150885.10<\/td>\n<\/tr>\n<tr>\n<th>&#8230;<\/th>\n<td>&#8230;<\/td>\n<td>&#8230;<\/td>\n<td>&#8230;<\/td>\n<\/tr>\n<tr>\n<th>163<\/th>\n<td>Wed<\/td>\n<td>19<\/td>\n<td>105530.85<\/td>\n<\/tr>\n<tr>\n<th>164<\/th>\n<td>Wed<\/td>\n<td>20<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>165<\/th>\n<td>Wed<\/td>\n<td>21<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>166<\/th>\n<td>Wed<\/td>\n<td>22<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>167<\/th>\n<td>Wed<\/td>\n<td>23<\/td>\n<td>0.00<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>168 rows \u00d7 3 columns<\/p>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\"><span class=\"hljs-attribute\">powerpivot<\/span>\n<\/code><\/pre>\n<\/div>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {<br \/>\n      vertical-align: middle;<br \/>\n    }<\/p>\n<p>    .dataframe tbody tr th {<br \/>\n      vertical-align: top;<br \/>\n    }<\/p>\n<p>    .dataframe thead th {<br \/>\n      text-align: right;<br \/>\n    }<br \/>\n  <\/style>\n<table class=\"dataframe\" border=\"1\">\n<thead>\n<tr style=\"text-align: right;\">\n<th>hour<\/th>\n<th>00<\/th>\n<th>01<\/th>\n<th>02<\/th>\n<th>03<\/th>\n<th>04<\/th>\n<th>05<\/th>\n<th>06<\/th>\n<th>07<\/th>\n<th>08<\/th>\n<th>09<\/th>\n<th>&#8230;<\/th>\n<th>14<\/th>\n<th>15<\/th>\n<th>16<\/th>\n<th>17<\/th>\n<th>18<\/th>\n<th>19<\/th>\n<th>20<\/th>\n<th>21<\/th>\n<th>22<\/th>\n<th>23<\/th>\n<\/tr>\n<tr>\n<th>day_of_week<\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>Sun<\/th>\n<td>0.00<\/td>\n<td>51497.60<\/td>\n<td>291117.90<\/td>\n<td>292769.57<\/td>\n<td>291190.81<\/td>\n<td>291278.86<\/td>\n<td>290997.18<\/td>\n<td>491656.62<\/td>\n<td>513788.41<\/td>\n<td>510171.87<\/td>\n<td>&#8230;<\/td>\n<td>213315.17<\/td>\n<td>288440.83<\/td>\n<td>263605.47<\/td>\n<td>208461.53<\/td>\n<td>211521.67<\/td>\n<td>211974.35<\/td>\n<td>212378.75<\/td>\n<td>210879.87<\/td>\n<td>209623.45<\/td>\n<td>206585.15<\/td>\n<\/tr>\n<tr>\n<th>Sat<\/th>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>269834.76<\/td>\n<td>458969.12<\/td>\n<td>915983.93<\/td>\n<td>918758.96<\/td>\n<td>921725.76<\/td>\n<td>999486.05<\/td>\n<td>1206349.12<\/td>\n<td>1210010.29<\/td>\n<td>&#8230;<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>Fr<\/th>\n<td>0.00<\/td>\n<td>224969.23<\/td>\n<td>864557.15<\/td>\n<td>1119128.11<\/td>\n<td>1150885.10<\/td>\n<td>1157386.84<\/td>\n<td>1156024.29<\/td>\n<td>1153747.56<\/td>\n<td>1158855.92<\/td>\n<td>1158471.02<\/td>\n<td>&#8230;<\/td>\n<td>181962.75<\/td>\n<td>120546.90<\/td>\n<td>650737.81<\/td>\n<td>633932.26<\/td>\n<td>132555.43<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>Thu<\/th>\n<td>0.00<\/td>\n<td>309328.00<\/td>\n<td>932204.37<\/td>\n<td>1205611.23<\/td>\n<td>1207128.36<\/td>\n<td>1204462.24<\/td>\n<td>1206721.36<\/td>\n<td>1208640.58<\/td>\n<td>1204511.73<\/td>\n<td>1199805.57<\/td>\n<td>&#8230;<\/td>\n<td>287940.39<\/td>\n<td>287652.30<\/td>\n<td>290639.87<\/td>\n<td>287504.60<\/td>\n<td>65143.31<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>Wed<\/th>\n<td>0.00<\/td>\n<td>281027.87<\/td>\n<td>749927.37<\/td>\n<td>1100732.95<\/td>\n<td>1153720.09<\/td>\n<td>1151129.83<\/td>\n<td>1153740.49<\/td>\n<td>1156341.91<\/td>\n<td>1153000.58<\/td>\n<td>1147049.35<\/td>\n<td>&#8230;<\/td>\n<td>0.00<\/td>\n<td>296933.91<\/td>\n<td>861515.44<\/td>\n<td>618844.71<\/td>\n<td>372767.37<\/td>\n<td>105530.85<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>Tue<\/th>\n<td>26562.56<\/td>\n<td>445447.54<\/td>\n<td>683084.53<\/td>\n<td>1342209.28<\/td>\n<td>1151558.18<\/td>\n<td>1147726.28<\/td>\n<td>1149619.97<\/td>\n<td>1150122.07<\/td>\n<td>1152870.25<\/td>\n<td>1148160.37<\/td>\n<td>&#8230;<\/td>\n<td>282747.19<\/td>\n<td>298448.77<\/td>\n<td>612924.25<\/td>\n<td>572219.97<\/td>\n<td>545555.71<\/td>\n<td>284165.57<\/td>\n<td>286591.83<\/td>\n<td>286551.77<\/td>\n<td>219794.28<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<th>Mon<\/th>\n<td>206121.08<\/td>\n<td>419298.17<\/td>\n<td>1068524.79<\/td>\n<td>1550715.82<\/td>\n<td>1630477.85<\/td>\n<td>1630106.16<\/td>\n<td>1680749.36<\/td>\n<td>1412979.20<\/td>\n<td>1332721.77<\/td>\n<td>1338198.34<\/td>\n<td>&#8230;<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>33988.80<\/td>\n<td>290805.45<\/td>\n<td>291424.27<\/td>\n<td>291727.70<\/td>\n<td>242969.68<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<td>0.00<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>7 rows \u00d7 24 columns<\/p>\n<\/div>\n<h3 id=\"analyzing-the-pattern\">\u30d1\u30bf\u30fc\u30f3\u3092\u5206\u6790\u3059\u308b<\/h3>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\"><span class=\"hljs-keyword\">import<\/span> seaborn <span class=\"hljs-keyword\">as<\/span> sns\n<span class=\"hljs-title\">ax<\/span> = sns.heatmap(powerpivot)\n<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/12\/output_64_0.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27137\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/12\/output_64_0.png\" alt=\"\" width=\"1039\" height=\"491\" srcset=\"\/wp-content\/uploads\/2020\/12\/output_64_0.png 1039w, \/wp-content\/uploads\/2020\/12\/output_64_0-300x142.png 300w, \/wp-content\/uploads\/2020\/12\/output_64_0-768x363.png 768w, \/wp-content\/uploads\/2020\/12\/output_64_0-1024x484.png 1024w, \/wp-content\/uploads\/2020\/12\/output_64_0-600x284.png 600w\" sizes=\"(max-width: 1039px) 100vw, 1039px\" \/><\/a><\/p>\n<p>\u5927\u5b66\u69cb\u5185\u306e\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u898b\u308b\u3068\u3001\u5f53\u7136\u306e\u3088\u3046\u306b\u5348\u5f8c\u304b\u3089\u96fb\u91cf\u6d88\u8cbb\u304c\u6e1b\u3063\u3066\u3044\u307e\u3059\u3002\u6388\u696d\u306f\u5348\u524d\u4e2d\u306b\u884c\u308f\u308c\u307e\u3059\u304b\u3089\u306d\u3002<\/p>\n<p>\u6bce\u9031\u30d4\u30fc\u30af\u306f\u6c34\u66dc\u65e5\u3067\u3059\u3002\u5148\u307b\u3069\u306e\u63a8\u5bdf\u306f\u60dc\u3057\u304b\u3063\u305f\u3067\u3059\u306d\u3002<br \/>\n\u3057\u304b\u3057\u5224\u7136\u3068\u3057\u307e\u305b\u3093\u3002\u706b\u66dc\u65e5\u306e\u307b\u3046\u304c\u7d2b\u306e\u6642\u9593\u5e2f\u304c\u591a\u3044\u306e\u306b\u3001\u6c34\u66dc\u65e5\u306e\u307b\u3046\u304c\u8d64\u3044\u6642\u9593\u5e2f\u304c\u591a\u3044\u306e\u3067\u3059\u3002<\/p>\n<p>\u305d\u308c\u306b\u6d88\u8cbb\u304c\u6700\u3082\u591a\u3044\u6642\u9593\u5e2f\u304c\u5348\u524d3\u6642\u304b\u30897\u6642\u306a\u306e\u306f\u3001\u3069\u3046\u3057\u3066\u3067\u3057\u3087\u3046\u304b\u3002<br \/>\n\u3053\u3093\u306a\u591c\u660e\u3051\u306b\u3001\u8ab0\u304c\u3053\u308c\u307b\u3069\u306e\u96fb\u529b\u3092\u5fc5\u8981\u3068\u3057\u3066\u3044\u308b\u306e\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<h2 id=\"bonus-grouped-line-charts\">\u304a\u307e\u3051\uff1a\u6298\u308c\u7dda\u30b0\u30e9\u30d5\u306e\u30b0\u30eb\u30fc\u30d7\u5316<\/h2>\n<p>\u4e0b\u56f3\u306e\u3088\u3046\u306b\u7c21\u5358\u306a\u8907\u6570\u6298\u308c\u7dda\u30b0\u30e9\u30d5\u3082\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\"><span class=\"hljs-symbol\">sns.lineplot<\/span>(<span class=\"hljs-meta\">data<\/span><span class=\"hljs-symbol\">=powergrouped<\/span>, x=<span class=\"hljs-string\">\"hour\"<\/span>, y=<span class=\"hljs-string\">\"power\"<\/span>, hue=<span class=\"hljs-string\">\"day_of_week\"<\/span>)\n<\/code><\/pre>\n<\/div>\n<pre><code>&lt;<span class=\"hljs-string\">AxesSubplot:<\/span>xlabel=<span class=\"hljs-string\">'hour'<\/span>, ylabel=<span class=\"hljs-string\">'power'<\/span>&gt;\n<\/code><\/pre>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/12\/output_68_1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-27136\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/12\/output_68_1.png\" alt=\"\" width=\"1181\" height=\"496\" srcset=\"\/wp-content\/uploads\/2020\/12\/output_68_1.png 1181w, \/wp-content\/uploads\/2020\/12\/output_68_1-300x126.png 300w, \/wp-content\/uploads\/2020\/12\/output_68_1-768x323.png 768w, \/wp-content\/uploads\/2020\/12\/output_68_1-1024x430.png 1024w, \/wp-content\/uploads\/2020\/12\/output_68_1-600x252.png 600w\" sizes=\"(max-width: 1181px) 100vw, 1181px\" \/><\/a><\/p>\n<p>\u554f\u984c\u306f\u3001\u3069\u306e\u7dda\u304c\u4f55\u3092\u8868\u3059\u304b\u304c\u7169\u96d1\u306a\u306e\u3067\u3001\u4f55\u304b\u8208\u5473\u6df1\u3044\u3053\u3068\u306b\u6c17\u3065\u304f\u305f\u3073\u306b\u51e1\u4f8b\u3092\u53c2\u7167\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3053\u3068\u3067\u3059\u3002<br \/>\n\u30d2\u30fc\u30c8\u30de\u30c3\u30d7\u3092\u88dc\u8db3\u3059\u308b\u306a\u3089\u3001\u5c0f\u3055\u306a\u6642\u7cfb\u5217\u30b0\u30e9\u30d5\u3092\u8907\u6570\u6301\u3064\u30b0\u30ea\u30c3\u30c9\u304c\u6709\u52b9\u3067\u3059\u3002<br \/>\n\u5404\u66dc\u65e5\u306e\u30c8\u30ec\u30f3\u30c9\u3092\u5207\u308a\u5206\u3051\u3066\u3001\u30d4\u30fc\u30af\u3068\u30ae\u30e3\u30c3\u30d7\u306b\u7126\u70b9\u3092\u5f53\u3066\u308b\u306e\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"lang-python\">powergrouped['day_of_week'] = pd.Categorical(powergrouped['day_of_week'], new_order[::-<span class=\"hljs-number\">1<\/span>])\n<span class=\"hljs-attr\">powergrouped<\/span> = powergrouped.sort_values(<span class=\"hljs-attr\">by<\/span> = 'day_of_week')\n\n<span class=\"hljs-attr\">g<\/span> = sns.relplot(\n    <span class=\"hljs-attr\">data=powergrouped,<\/span>\n    <span class=\"hljs-attr\">x=\"hour\",<\/span> <span class=\"hljs-attr\">y=\"power\",<\/span> <span class=\"hljs-attr\">col=\"day_of_week\",<\/span> <span class=\"hljs-attr\">hue=\"day_of_week\",<\/span>\n    <span class=\"hljs-attr\">kind=\"line\",<\/span> <span class=\"hljs-attr\">palette=\"crest\",<\/span> <span class=\"hljs-attr\">linewidth=4,<\/span> <span class=\"hljs-attr\">zorder=5,<\/span>\n    <span class=\"hljs-attr\">col_wrap=3,<\/span> <span class=\"hljs-attr\">height=2,<\/span> <span class=\"hljs-attr\">aspect=1.5,<\/span> <span class=\"hljs-attr\">legend=False,<\/span>\n)\n\nfor day_of_week, ax <span class=\"hljs-keyword\">in<\/span> g.axes_dict.items():\n\n\n    ax.text(.<span class=\"hljs-number\">8<\/span>, .<span class=\"hljs-number\">85<\/span>, day_of_week, <span class=\"hljs-attr\">transform=ax.transAxes,<\/span> <span class=\"hljs-attr\">fontweight=\"bold\")<\/span>\n\n\n    sns.lineplot(\n        <span class=\"hljs-attr\">data=powergrouped,<\/span> <span class=\"hljs-attr\">x=\"hour\",<\/span> <span class=\"hljs-attr\">y=\"power\",<\/span> <span class=\"hljs-attr\">units=\"day_of_week\",<\/span>\n        <span class=\"hljs-attr\">estimator=None,<\/span> <span class=\"hljs-attr\">color=\".7\",<\/span> <span class=\"hljs-attr\">linewidth=1,<\/span> <span class=\"hljs-attr\">ax=ax,<\/span>\n    )\n\nax.set_xticks(ax.get_xticks()[::<span class=\"hljs-number\">4<\/span>])\n\n\ng.set_titles(<span class=\"hljs-string\">\"\"<\/span>)\ng.set_axis_labels(<span class=\"hljs-string\">\"\"<\/span>, <span class=\"hljs-string\">\"power\"<\/span>)\n<\/code><\/pre>\n<\/div>\n<pre><code>&lt;seaborn<span class=\"hljs-selector-class\">.axisgrid<\/span><span class=\"hljs-selector-class\">.FacetGrid<\/span> at <span class=\"hljs-number\">0<\/span>x7f105ecbf8b0&gt;\n<\/code><\/pre>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/12\/output_70_1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-27135\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/12\/output_70_1.png\" alt=\"\" width=\"653\" height=\"415\" srcset=\"\/wp-content\/uploads\/2020\/12\/output_70_1.png 653w, \/wp-content\/uploads\/2020\/12\/output_70_1-300x191.png 300w, \/wp-content\/uploads\/2020\/12\/output_70_1-600x381.png 600w\" sizes=\"(max-width: 653px) 100vw, 653px\" \/><\/a><\/p>\n<p>\u3053\u306e\u6700\u7d42\u7684\u306a\u53ef\u8996\u5316\u3067\u3001\u96fb\u529b\u6d88\u8cbb\u91cf\u306f\u66dc\u65e5\u3068\u6642\u9593\u5e2f\u306b\u3088\u3063\u3066\u5927\u304d\u304f\u5909\u308f\u308b\u3068\u3044\u3046\u4e8b\u5b9f\u304c\u660e\u78ba\u306b\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<h2 id=\"conclusion-energy-saving-potential\">\u7d50\u8ad6\uff1a\u7701\u30a8\u30cd\u304c\u898b\u8fbc\u3081\u308b\u65b9\u6cd5<\/h2>\n<p>\u5f53\u521d\u306e\u5206\u6790\u306e\u76ee\u7684\u306b\u7acb\u3061\u8fd4\u308a\u3001\u3088\u308a\u8a73\u3057\u304f\u8abf\u3079\u308b\u305f\u3081\u306e\u65b9\u5411\u6027\u3092\u3044\u304f\u3064\u304b\u63d0\u6848\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u6708\u66dc\u5348\u524d\u4e2d\u306e\u96fb\u529b\u6d88\u8cbb\u91cf\u306e\u524a\u6e1b\u7b56\uff1a\u65e5\u66dc\u65e5\u306b\u3082\u3046\u5c11\u3057\u6e29\u3081\u3066\u304a\u304f<\/li>\n<li>\u6c34\u66dc\u3001\u706b\u66dc\u3001\u91d1\u66dc\u306e\u5348\u5f8c\u306e\u6d3b\u52d5\u306b\u3064\u3044\u3066\uff1a\u6388\u696d\u304c\u3042\u308b\u304b\u78ba\u8a8d\u3059\u308b<\/li>\n<\/ul>\n<p>\u6700\u3082\u6709\u52b9\u306a\u6226\u7565\u306f\u3001\u96fb\u529b\u6d88\u8cbb\u91cf\u3092\u5e73\u5766\u306b\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u6d88\u8cbb\u91cf\u304c\u4e0b\u304c\u3063\u305f\u3042\u3068\u306f\u5fc5\u305a\u5927\u5e45\u306a\u5897\u52a0\u304c\u898b\u3089\u308c\u307e\u3059\u3002<br \/>\n\u9031\u672b\u306b\u4f4e\u3044\u6e29\u5ea6\u3067\u6e29\u3081\u3066\u304a\u3051\u3070\u3001\u6708\u66dc\u65e5\u306b\u6fc0\u3057\u304f\u6e29\u3081\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h2 id=\"a-short-afterward\">\u6700\u5f8c\u306b\u4e00\u8a00<\/h2>\n<p>rolling window\u3084\u96c6\u8a08\u306a\u3069\u5225\u306e\u65b9\u6cd5\u3067\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br \/>\n\u30d2\u30fc\u30c8\u30de\u30c3\u30d7\u3068\u8907\u6570\u6298\u308c\u7dda\u30b0\u30e9\u30d5\u306f\u3001\u30c8\u30ec\u30f3\u30c9\u306e\u89e3\u660e\u3068\u3001\u30c7\u30fc\u30bf\u306e\u30cf\u30ba\u30ec\u5024\u3092\u7279\u5b9a\u3059\u308b\u306e\u306b\u6709\u52b9\u3067\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u3092CSV\u30d5\u30a1\u30a4\u30eb\u306b\u6c38\u7d9a\u7684\u306b\u683c\u7d0d\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3059\u308b\u65b9\u6cd5\u306b\u306f\u305f\u304f\u3055\u3093\u306e\u5229\u70b9\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u7121\u6570\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3057\u306a\u304f\u3066\u6e08\u307f\u3001\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u6ea2\u308c\u3055\u305b\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/li>\n<li>\u30cf\u30fc\u30c9\u30c9\u30e9\u30a4\u30d6\u306b\u5341\u5206\u306a\u7a7a\u304d\u5bb9\u91cf\u304c\u751f\u307e\u308c\u307e\u3059\u3002<\/li>\n<li>\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30ab\u30eb\u306b\u4fdd\u5b58\u3059\u308b\u3088\u308a\u3082\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3057\u305f\u307b\u3046\u304c\u5b89\u5168\u3067\u3059\u3002<\/li>\n<\/ul>\n<p>\u30d7\u30ed\u30c3\u30c8\u3092\u304a\u697d\u3057\u307f\u304f\u3060\u3055\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u3068\u76ee\u7684 \u4f7f\u7528\u4f8b \u81ea\u5206\u304c\u8907\u5408\u30d3\u30eb\u306e\u30aa\u30fc\u30ca\u30fc\u3060\u3068\u3057\u307e\u3059\u3002\u96fb\u529b\u6d88\u8cbb\u91cf\u3092\u76e3\u8996\u3059\u308b\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u3092\u5efa\u7269\u306e\u3042\u3061\u3053\u3061\u306b\u8a2d\u7f6e\u3057\u3066\u3044\u3066\u3001\u5404\u88c5\u7f6e\u306f1\u5206\u9593\u306b2\u56de\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u96fb\u529b\u6d88\u8cbb\u91cf\u306e\u30c7\u30fc\u30bf\u306f\u30ad\u30ed\u30ef\u30c3\u30c8\u3067\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3 [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":49183,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1005],"tags":[],"class_list":["post-50718","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1005"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>GridDB\u3068Jupyter Notebook\u3092\u4f7f\u3063\u3066\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"\u6982\u8981\u3068\u76ee\u7684 \u4f7f\u7528\u4f8b\" \/>\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\/ja\/\u672a\u5206\u985e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GridDB\u3068Jupyter Notebook\u3092\u4f7f\u3063\u3066\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"\u6982\u8981\u3068\u76ee\u7684 \u4f7f\u7528\u4f8b\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/\" \/>\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=\"2020-12-18T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-14T15:54:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.griddb.net\/wp-content\/uploads\/2020\/12\/output_68_1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1181\" \/>\n\t<meta property=\"og:image:height\" content=\"496\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\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=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"griddb-admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"GridDB\u3068Jupyter Notebook\u3092\u4f7f\u3063\u3066\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b\",\"datePublished\":\"2020-12-18T08:00:00+00:00\",\"dateModified\":\"2025-11-14T15:54:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/\"},\"wordCount\":116,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2020\/12\/output_68_1.png\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/\",\"url\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/\",\"name\":\"GridDB\u3068Jupyter Notebook\u3092\u4f7f\u3063\u3066\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2020\/12\/output_68_1.png\",\"datePublished\":\"2020-12-18T08:00:00+00:00\",\"dateModified\":\"2025-11-14T15:54:15+00:00\",\"description\":\"\u6982\u8981\u3068\u76ee\u7684 \u4f7f\u7528\u4f8b\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2020\/12\/output_68_1.png\",\"contentUrl\":\"\/wp-content\/uploads\/2020\/12\/output_68_1.png\",\"width\":1181,\"height\":496},{\"@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\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@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\":\"ja\",\"@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:\/\/www.griddb.net\/ja\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GridDB\u3068Jupyter Notebook\u3092\u4f7f\u3063\u3066\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b | GridDB: Open Source Time Series Database for IoT","description":"\u6982\u8981\u3068\u76ee\u7684 \u4f7f\u7528\u4f8b","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\/ja\/\u672a\u5206\u985e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/","og_locale":"ja_JP","og_type":"article","og_title":"GridDB\u3068Jupyter Notebook\u3092\u4f7f\u3063\u3066\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b | GridDB: Open Source Time Series Database for IoT","og_description":"\u6982\u8981\u3068\u76ee\u7684 \u4f7f\u7528\u4f8b","og_url":"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2020-12-18T08:00:00+00:00","article_modified_time":"2025-11-14T15:54:15+00:00","og_image":[{"width":1181,"height":496,"url":"https:\/\/www.griddb.net\/wp-content\/uploads\/2020\/12\/output_68_1.png","type":"image\/png"}],"author":"griddb-admin","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"\u57f7\u7b46\u8005":"griddb-admin","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"4\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/"},"author":{"name":"griddb-admin","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"GridDB\u3068Jupyter Notebook\u3092\u4f7f\u3063\u3066\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b","datePublished":"2020-12-18T08:00:00+00:00","dateModified":"2025-11-14T15:54:15+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/"},"wordCount":116,"commentCount":0,"publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2020\/12\/output_68_1.png","inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/","url":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/","name":"GridDB\u3068Jupyter Notebook\u3092\u4f7f\u3063\u3066\u30b9\u30de\u30fc\u30c8\u30e1\u30fc\u30bf\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2020\/12\/output_68_1.png","datePublished":"2020-12-18T08:00:00+00:00","dateModified":"2025-11-14T15:54:15+00:00","description":"\u6982\u8981\u3068\u76ee\u7684 \u4f7f\u7528\u4f8b","inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/making-sense-out-of-smart-metering-data-with-griddb-and-jupyter-notebook\/#primaryimage","url":"\/wp-content\/uploads\/2020\/12\/output_68_1.png","contentUrl":"\/wp-content\/uploads\/2020\/12\/output_68_1.png","width":1181,"height":496},{"@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":"ja"},{"@type":"Organization","@id":"https:\/\/griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"ja","@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":"ja","@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:\/\/www.griddb.net\/ja\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/comments?post=50718"}],"version-history":[{"count":1,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50718\/revisions"}],"predecessor-version":[{"id":51556,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50718\/revisions\/51556"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/media\/49183"}],"wp:attachment":[{"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/media?parent=50718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/categories?post=50718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/tags?post=50718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}