양윤지

data collection

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 데이터 수집\n",
"데이터 : 코스피200 지수 종가/오픈/고가/저가/거래량 <br>\n",
"수집 출처 : investing.com\n",
"\n",
"|<center>**Data Set**</center>|<center>**Period**</center>|<center>**Number of Data**</center>|\n",
"|------|---|:---|\n",
"|Training Data|2005/01/03 ~ 2018/12/28|3464|\n",
"|Test Data|2019/01/02 ~ 2019/12/30|246|\n",
"|Validation Data|2020/01/02 ~ 2020/09/29|188|"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'date'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-2-7e78e5e4da43>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mpandas\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mtqdm\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mtqdm\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mdate\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'date'"
]
}
],
"source": [
"# module\n",
"\n",
"import pandas as pd\n",
"from tqdm import tqdm\n",
"import date"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"train_data = pd.read_csv('/Users/yangyoonji/Documents/2020_2학기/캡스톤디자인/data/train_data.csv')\n",
"test_data = pd.read_csv('/Users/yangyoonji/Documents/2020_2학기/캡스톤디자인/data/test_data.csv')\n",
"validation_data = pd.read_csv('/Users/yangyoonji/Documents/2020_2학기/캡스톤디자인/data/validation_data.csv')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"for i in tqdm(range(len(train_data))):\n",
" train_data['date'][i] = train_data['date'][i].replace(' ','-') "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"train_data.head(3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"for i in range(len(train_data)):\n",
" train_data['date'][i] = datetime.datetime.strptime(train_data['date'][i],\"%Y-%m-%d\").date()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"test_data.head(3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"validation_data.head(3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}
This diff is collapsed. Click to expand it.
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
,date,close,open,high,low,vol
0,20200102,290.35,294.19,294.57,289.96,66160000.0
1,20200103,290.74,293.1,294.88,289.04,79770000.0
2,20200106,288.43,287.73,289.41,287.49,69960000.0
3,20200107,291.23,290.01,292.26,289.64,65349999.99999999
4,20200108,289.42,288.94,291.01,287.3,124530000.0
5,20200109,294.41,293.83,294.41,292.1,111790000.0
6,20200110,297.06,294.8,297.17,294.17,94160000.0
7,20200113,300.13,296.62,300.31,296.53,81680000.0
8,20200114,301.53,302.2,303.61,300.69,92120000.0
9,20200115,299.74,299.91,301.13,298.82,71770000.0
10,20200116,302.78,299.93,302.91,298.95,85710000.0
11,20200117,303.3,305.07,306.05,302.51,81540000.0
12,20200120,305.58,304.99,307.54,304.77,78040000.0
13,20200121,302.11,304.94,306.09,301.85,67630000.0
14,20200122,306.08,301.79,306.52,301.16,79330000.0
15,20200123,302.33,303.77,304.72,301.71,86910000.0
16,20200128,292.77,294.98,296.3,291.3,130169999.99999999
17,20200129,293.98,294.38,295.67,292.45,85730000.0
18,20200130,288.37,293.27,294.11,287.09,101540000.0
19,20200131,284.53,290.24,291.47,284.53,101460000.0
20,20200203,285.05,280.17,286.24,279.78,111060000.0
21,20200204,290.68,285.19,291.38,285.11,105450000.0
22,20200205,292.02,293.57,294.26,290.3,102640000.0
23,20200206,300.65,294.74,300.98,294.32,110220000.0
24,20200207,298.21,299.59,300.05,296.01,108110000.0
25,20200210,296.24,294.07,296.73,293.33,72220000.0
26,20200211,299.28,297.91,301.1,297.48,78350000.0
27,20200212,301.54,299.83,302.2,298.09,110630000.0
28,20200213,300.93,302.79,304.43,300.48,115070000.0
29,20200214,303.01,300.95,304.2,299.18,80530000.0
30,20200217,302.76,302.84,304.05,300.99,84280000.0
31,20200218,297.74,300.26,301.29,297.2,84750000.0
32,20200219,298.33,299.68,300.38,295.53,84260000.0
33,20200220,296.65,300.34,301.35,295.01,90010000.0
34,20200221,292.42,292.16,295.24,291.96,100710000.0
35,20200224,281.02,285.51,286.62,281.02,132820000.0
36,20200225,284.24,280.48,284.63,279.77,117030000.0
37,20200226,279.94,278.45,281.98,277.68,119550000.0
38,20200227,277.09,279.46,281.09,276.07,110500000.0
39,20200228,268.02,272.33,273.98,267.23,202610000.0
40,20200302,270.37,269.59,272.6,265.7,163720000.0
41,20200303,271.56,277.44,277.54,270.79,146720000.0
42,20200304,278.13,270.13,278.9,270.13,208460000.0
43,20200305,281.38,280.66,282.05,277.91,147440000.0
44,20200306,275.1,276.74,278.31,274.0,140900000.0
45,20200309,263.11,266.39,267.75,261.76,182670000.0
46,20200310,264.67,261.94,265.57,260.75,173090000.0
47,20200311,257.01,264.63,265.04,255.69,194210000.0
48,20200312,247.62,253.93,255.49,243.76,242470000.0
49,20200313,240.65,231.71,246.19,227.36,298900000.0
50,20200316,232.97,245.21,245.21,232.76,175050000.0
51,20200317,226.89,222.94,234.56,222.46,216730000.0
52,20200318,215.83,228.63,230.04,215.81,208040000.0
53,20200319,199.28,220.72,220.85,196.27,303560000.0
54,20200320,213.67,204.84,214.08,200.54,269350000.0
55,20200323,201.87,200.8,206.66,198.67,210300000.0
56,20200324,220.34,207.65,220.34,205.41,225730000.0
57,20200325,232.89,228.37,233.42,224.74,306110000.0
58,20200326,229.34,231.91,236.61,229.22,290840000.0
59,20200327,233.79,239.11,239.48,227.01,249100000.0
60,20200330,232.45,227.05,234.7,225.09,167230000.0
61,20200331,236.82,235.2,237.47,232.5,240440000.0
62,20200401,226.35,234.23,237.52,226.34,228580000.0
63,20200402,231.84,227.47,232.22,223.6,181790000.0
64,20200403,231.7,232.48,234.45,229.23,181040000.0
65,20200406,240.81,234.4,241.19,233.75,190740000.0
66,20200407,244.87,245.65,247.39,240.68,224450000.0
67,20200408,241.89,243.71,246.99,241.77,173120000.0
68,20200409,245.61,246.13,246.46,243.11,175940000.0
69,20200410,248.0,245.14,248.21,244.02,286110000.0
70,20200413,243.4,246.59,246.9,243.39,195900000.0
71,20200414,247.45,246.2,248.55,244.58,193120000.0
72,20200416,247.1,244.99,247.87,243.61,197540000.0
73,20200417,255.02,252.52,257.37,252.38,287360000.0
74,20200420,252.14,253.85,255.93,251.46,211000000.0
75,20200421,249.4,250.26,251.88,245.11,257160000.00000003
76,20200422,251.88,246.16,252.18,244.56,184500000.0
77,20200423,253.74,253.42,255.22,251.58,163810000.0
78,20200424,250.28,252.47,252.86,249.19,154310000.0
79,20200427,254.84,251.18,255.79,250.61,151360000.0
80,20200428,256.39,255.91,257.34,253.22,172420000.0
81,20200429,258.15,256.58,259.67,256.04,184480000.0
82,20200504,250.6,252.44,253.7,250.34,174040000.0
83,20200506,255.0,253.76,255.01,251.26,133280000.0
84,20200507,254.46,253.88,256.14,253.37,114360000.0
85,20200508,256.62,256.66,258.29,256.23,125220000.0
86,20200511,254.95,257.67,258.87,254.59,144300000.0
87,20200512,253.37,255.33,255.56,250.98,166800000.0
88,20200513,255.85,250.03,255.85,249.95,141250000.0
89,20200514,253.65,253.26,254.39,252.09,167640000.0
90,20200515,253.79,255.34,255.49,252.02,228900000.0
91,20200518,255.44,254.55,256.31,252.95,223000000.0
92,20200519,261.79,261.12,262.34,259.96,253330000.0
93,20200520,262.72,260.48,263.25,260.48,140300000.0
94,20200521,263.74,264.52,264.85,263.07,159480000.0
95,20200522,259.62,263.82,264.07,258.34,166030000.0
96,20200525,262.76,260.95,262.82,259.16,125430000.0
97,20200526,267.31,263.48,267.31,262.95,175420000.0
98,20200527,267.64,266.71,269.17,265.86,247180000.0
99,20200528,268.29,270.17,271.44,264.85,248930000.0
100,20200529,268.32,266.62,269.61,265.23,269470000.0
101,20200601,273.19,269.29,273.39,268.93,171510000.0
102,20200602,276.08,272.65,276.47,272.22,251030000.0
103,20200603,285.91,279.14,287.49,278.98,476500000.0
104,20200604,286.45,291.17,292.9,284.93,364580000.0
105,20200605,290.62,286.3,291.5,284.5,282060000.0
106,20200608,290.77,295.41,295.68,289.71,286660000.0
107,20200609,291.32,293.96,294.87,287.83,268570000.0
108,20200610,291.9,291.03,292.92,289.6,229070000.0
109,20200611,288.62,289.98,292.08,284.29,275900000.0
110,20200612,281.78,276.97,282.54,276.05,232830000.0
111,20200615,267.95,278.61,280.87,267.95,262440000.0
112,20200616,282.59,275.89,282.59,274.0,247890000.0
113,20200617,283.02,282.08,284.9,278.33,337220000.0
114,20200618,281.91,281.74,283.39,280.02,181590000.0
115,20200619,283.37,284.56,284.7,278.53,189130000.0
116,20200622,281.42,281.01,283.71,280.34,139840000.0
117,20200623,281.94,284.64,286.04,279.26,163680000.0
118,20200624,286.7,283.71,288.3,283.3,200570000.0
119,20200625,279.73,282.38,284.36,279.73,152980000.0
120,20200626,283.38,283.36,284.58,280.65,169010000.0
121,20200629,278.04,279.36,281.77,277.06,137760000.0
122,20200630,280.09,282.55,283.98,280.09,179500000.0
123,20200701,280.26,283.1,283.84,279.44,133800000.00000001
124,20200702,283.86,281.3,283.89,280.71,111370000.0
125,20200703,285.89,285.59,286.09,283.36,100220000.0
126,20200706,290.62,286.84,291.14,286.31,128120000.0
127,20200707,286.77,292.74,292.98,286.76,156130000.0
128,20200708,285.97,287.2,288.41,285.18,119450000.0
129,20200709,287.25,287.8,289.41,287.08,140610000.0
130,20200710,285.06,287.87,288.09,283.51,136770000.0
131,20200713,289.84,287.92,290.49,286.86,127050000.0
132,20200714,289.63,288.42,289.63,286.89,126300000.0
133,20200715,292.27,292.94,294.42,290.89,168350000.0
134,20200716,289.25,292.34,292.74,288.46,129449999.99999999
135,20200717,291.57,289.9,292.1,289.9,118640000.0
136,20200720,290.81,292.76,292.76,289.01,161820000.0
137,20200721,295.16,294.03,296.11,293.2,366990000.0
138,20200722,294.04,294.71,296.14,293.39,327320000.0
139,20200723,292.37,293.62,293.62,290.49,250980000.0
140,20200724,290.66,289.84,292.74,289.42,216210000.0
141,20200727,293.51,291.03,295.26,290.82,193240000.0
142,20200728,300.13,296.53,301.34,296.38,301280000.0
143,20200729,301.25,300.57,303.51,299.61,264440000.0
144,20200730,301.85,303.13,304.13,301.49,191760000.0
145,20200731,299.32,303.69,304.16,298.89,201960000.0
146,20200803,299.46,299.57,300.33,297.57,179730000.0
147,20200804,303.04,302.5,304.27,301.48,219870000.0
148,20200805,306.64,303.94,306.67,302.91,210810000.0
149,20200806,311.32,307.88,312.84,307.88,254200000.0
150,20200807,312.57,311.99,314.11,310.0,299120000.0
151,20200810,316.77,312.75,317.84,312.08,261180000.0
152,20200811,321.02,317.63,322.64,317.56,297600000.0
153,20200812,322.68,320.31,322.68,317.3,293140000.0
154,20200813,323.33,325.84,326.22,319.66,285740000.0
155,20200814,319.24,321.59,322.66,316.28,260399999.99999997
156,20200818,312.84,319.57,321.69,311.2,247520000.0
157,20200819,313.54,315.96,316.82,313.18,159930000.0
158,20200820,301.59,310.45,312.77,301.15,249740000.0
159,20200821,306.16,306.17,309.88,303.15,166300000.0
160,20200824,309.33,306.86,310.27,303.39,142210000.0
161,20200825,313.59,312.45,314.14,310.57,197820000.0
162,20200826,314.19,313.61,315.08,309.74,193540000.0
163,20200827,311.38,314.46,315.17,311.37,175570000.0
164,20200828,312.24,313.86,315.95,311.06,256410000.00000003
165,20200831,307.14,315.46,316.11,307.12,312180000.0
166,20200901,309.81,309.08,311.15,307.63,342810000.0
167,20200902,311.5,311.69,312.92,308.52,337040000.0
168,20200903,316.43,314.73,317.46,314.45,342180000.0
169,20200904,312.03,308.25,312.64,308.04,408030000.0
170,20200907,313.67,312.08,314.44,310.93,264670000.00000003
171,20200908,317.38,316.31,317.43,314.56,227270000.0
172,20200909,313.77,313.54,315.9,312.9,198500000.0
173,20200910,316.53,317.92,318.38,315.46,234270000.0
174,20200911,316.45,315.64,316.77,313.2,165160000.0
175,20200914,320.98,319.83,321.22,318.54,176780000.0
176,20200915,323.36,321.82,323.57,320.54,152450000.0
177,20200916,322.31,323.14,324.19,321.52,146880000.0
178,20200917,318.0,321.3,322.23,316.92,178300000.0
179,20200918,318.39,319.2,319.81,316.62,153540000.0
180,20200921,315.89,318.13,320.86,314.78,165860000.0
181,20200922,308.82,315.53,316.02,307.4,304360000.0
182,20200923,309.64,311.5,311.76,303.29,208050000.0
183,20200924,302.48,304.85,306.98,301.95,181250000.0
184,20200925,303.57,305.38,305.55,301.93,156860000.0
185,20200928,307.03,306.49,308.34,304.64,173180000.0
186,20200929,309.44,310.01,311.34,308.52,138820000.0
No preview for this file type