no commit message

parent 299cb1ac
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 135, "execution_count": 161,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 136, "execution_count": 162,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
"4 315.06 317.51 314.71 " "4 315.06 317.51 314.71 "
] ]
}, },
"execution_count": 136, "execution_count": 162,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 137, "execution_count": 163,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 138, "execution_count": 164,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -332,7 +332,7 @@ ...@@ -332,7 +332,7 @@
"4 1958 5 21320 1958.3699 317.51 314.71 317.86 315.06 317.51 314.71" "4 1958 5 21320 1958.3699 317.51 314.71 317.86 315.06 317.51 314.71"
] ]
}, },
"execution_count": 138, "execution_count": 164,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -350,7 +350,7 @@ ...@@ -350,7 +350,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 139, "execution_count": 165,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -393,7 +393,7 @@ ...@@ -393,7 +393,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 140, "execution_count": 166,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -508,7 +508,7 @@ ...@@ -508,7 +508,7 @@
"75 1964 4 23482 1964.2896 NaN NaN 321.83 319.45 321.83 319.45" "75 1964 4 23482 1964.2896 NaN NaN 321.83 319.45 321.83 319.45"
] ]
}, },
"execution_count": 140, "execution_count": 166,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -519,7 +519,7 @@ ...@@ -519,7 +519,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 141, "execution_count": 167,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -634,7 +634,7 @@ ...@@ -634,7 +634,7 @@
"6 1958 7 21381 1958.5370 315.86 315.19 315.86 315.22 315.86 315.19" "6 1958 7 21381 1958.5370 315.86 315.19 315.86 315.22 315.86 315.19"
] ]
}, },
"execution_count": 141, "execution_count": 167,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -653,7 +653,7 @@ ...@@ -653,7 +653,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 146, "execution_count": 170,
"metadata": { "metadata": {
"scrolled": true "scrolled": true
}, },
...@@ -662,6 +662,8 @@ ...@@ -662,6 +662,8 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"(743, 10)\n",
"(743,)\n",
"(745, 11)\n" "(745, 11)\n"
] ]
}, },
...@@ -754,7 +756,7 @@ ...@@ -754,7 +756,7 @@
" <td>314.99</td>\n", " <td>314.99</td>\n",
" <td>317.45</td>\n", " <td>317.45</td>\n",
" <td>315.16</td>\n", " <td>315.16</td>\n",
" <td>1958-07-01</td>\n", " <td>1958-06-01</td>\n",
" </tr>\n", " </tr>\n",
" <tr>\n", " <tr>\n",
" <th>4</th>\n", " <th>4</th>\n",
...@@ -768,7 +770,7 @@ ...@@ -768,7 +770,7 @@
" <td>315.06</td>\n", " <td>315.06</td>\n",
" <td>317.51</td>\n", " <td>317.51</td>\n",
" <td>314.71</td>\n", " <td>314.71</td>\n",
" <td>1958-08-01</td>\n", " <td>1958-07-01</td>\n",
" </tr>\n", " </tr>\n",
" <tr>\n", " <tr>\n",
" <th>...</th>\n", " <th>...</th>\n",
...@@ -796,7 +798,7 @@ ...@@ -796,7 +798,7 @@
" <td>412.05</td>\n", " <td>412.05</td>\n",
" <td>408.55</td>\n", " <td>408.55</td>\n",
" <td>412.06</td>\n", " <td>412.06</td>\n",
" <td>NaN</td>\n", " <td>2019-11-01</td>\n",
" </tr>\n", " </tr>\n",
" <tr>\n", " <tr>\n",
" <th>741</th>\n", " <th>741</th>\n",
...@@ -810,7 +812,7 @@ ...@@ -810,7 +812,7 @@
" <td>412.29</td>\n", " <td>412.29</td>\n",
" <td>408.43</td>\n", " <td>408.43</td>\n",
" <td>412.07</td>\n", " <td>412.07</td>\n",
" <td>NaN</td>\n", " <td>2019-12-01</td>\n",
" </tr>\n", " </tr>\n",
" <tr>\n", " <tr>\n",
" <th>742</th>\n", " <th>742</th>\n",
...@@ -824,7 +826,7 @@ ...@@ -824,7 +826,7 @@
" <td>412.54</td>\n", " <td>412.54</td>\n",
" <td>410.28</td>\n", " <td>410.28</td>\n",
" <td>412.56</td>\n", " <td>412.56</td>\n",
" <td>NaN</td>\n", " <td>2020-01-01</td>\n",
" </tr>\n", " </tr>\n",
" <tr>\n", " <tr>\n",
" <th>743</th>\n", " <th>743</th>\n",
...@@ -877,31 +879,38 @@ ...@@ -877,31 +879,38 @@
"0 NaN 1958-03-01 \n", "0 NaN 1958-03-01 \n",
"1 NaN 1958-04-01 \n", "1 NaN 1958-04-01 \n",
"2 314.44 1958-05-01 \n", "2 314.44 1958-05-01 \n",
"3 315.16 1958-07-01 \n", "3 315.16 1958-06-01 \n",
"4 314.71 1958-08-01 \n", "4 314.71 1958-07-01 \n",
".. ... ... \n", ".. ... ... \n",
"740 412.06 NaN \n", "740 412.06 2019-11-01 \n",
"741 412.07 NaN \n", "741 412.07 2019-12-01 \n",
"742 412.56 NaN \n", "742 412.56 2020-01-01 \n",
"743 412.78 NaN \n", "743 412.78 NaN \n",
"744 413.33 NaN \n", "744 413.33 NaN \n",
"\n", "\n",
"[745 rows x 11 columns]" "[745 rows x 11 columns]"
] ]
}, },
"execution_count": 146, "execution_count": 170,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
], ],
"source": [ "source": [
"data = data.dropna().copy()\n", "#data = data.dropna().copy()\n",
"\n",
"print(data.shape)\n",
"\n",
"period = [datetime.date(y,m,1) for y,m in zip(data['Yr'],data['Mn'])]\n", "period = [datetime.date(y,m,1) for y,m in zip(data['Yr'],data['Mn'])]\n",
"period = pd.Series(period)\n", "period = pd.Series(period)\n",
"print(period.shape)\n",
"\n",
"newdf = pd.concat([data,period],axis=1)\n", "newdf = pd.concat([data,period],axis=1)\n",
"\n",
"print(newdf.shape)\n", "print(newdf.shape)\n",
"#data['period'] = pd.Series([datetime.date(y,m,1) for y,m in zip(data['Yr'],data['Mn'])])\n", "#data['period'] = pd.Series([datetime.date(y,m,1) for y,m in zip(data['Yr'],data['Mn'])])\n",
"\n", "\n",
"period\n",
"#data1 = data1.set_index('period') \n", "#data1 = data1.set_index('period') \n",
"#data\n", "#data\n",
"newdf" "newdf"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment