data-visualize.ipynb
3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" <script type=\"text/javascript\">\n",
" window.PlotlyConfig = {MathJaxConfig: 'local'};\n",
" if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n",
" if (typeof require !== 'undefined') {\n",
" require.undef(\"plotly\");\n",
" requirejs.config({\n",
" paths: {\n",
" 'plotly': ['https://cdn.plot.ly/plotly-latest.min']\n",
" }\n",
" });\n",
" require(['plotly'], function(Plotly) {\n",
" window._Plotly = Plotly;\n",
" });\n",
" }\n",
" </script>\n",
" "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"start read_csv\n"
]
}
],
"source": [
"\n",
"import numpy as np # linear algebra\n",
"import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n",
"from bs4 import BeautifulSoup\n",
"import urllib\n",
"from urllib import request\n",
"import re\n",
"import json\n",
"from datetime import datetime\n",
"\n",
"import plotly.offline as py\n",
"py.init_notebook_mode(connected=True)\n",
"import plotly.graph_objs as go\n",
"import plotly.tools as tls\n",
"import matplotlib.pyplot as plt\n",
"from random import shuffle\n",
"import random\n",
"#Setup\n",
"#load dataset\n",
"print(\"start read_csv\")\n",
"df = pd.read_csv(\"trendresult.csv\")\n",
"\n",
"df = pd.DataFrame(df)\n",
"\n",
"fig, axes = plt.subplots(nrows=3, ncols=2)\n",
"\n",
"\n",
"#df.plot(title = \"Naver Trend - Stock-Daily\", figsize = (20, 10), legend = False)\n",
"\n",
"print(\"start read_csv_1\")\n",
"df2 = pd.read_csv(\"finace_285130.csv\")\n",
"df2 = pd.DataFrame(df2)\n",
"print(df2)\n",
"df[\"SK케미칼\"].plot(title = \"SK-chemical\", figsize = (20,10), legend = False,ax=axes[0,0])\n",
"print(df[\"SK케미칼\"])\n",
"df2.plot(title = \"SK-chemical - Stock-Daily\", figsize = (20, 10), legend = False,ax=axes[0,1])\n",
"\n",
"df3 = pd.read_csv(\"finace_307070.csv\")\n",
"df3 = pd.DataFrame(df3)\n",
"df[\"삼성머스트스팩3호\"].plot(title = \"삼성머스트스팩3호\", figsize = (20,10), legend = False,ax=axes[1,0])\n",
"print(df3)\n",
"print(df[\"삼성머스트스팩3호\"])\n",
"df3.plot(title = \"SK hos - Stock-Daily\", figsize = (20, 10), legend = False,ax=axes[1,1])\n",
"\n",
"df4 = pd.read_csv(\"finace_309930.csv\")\n",
"df4 = pd.DataFrame(df4)\n",
"df[\"SK4호스팩\"].plot(title = \"SK-호스팩\", figsize = (20,10), legend = False,ax=axes[2,0])\n",
"print(df4)\n",
"print(df[\"SK4호스팩\"])\n",
"df4.plot(title = \"samsung - Stock-Daily\", figsize = (20, 10), legend = False,ax=axes[2,1])\n"
]
}
],
"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.6.10"
}
},
"nbformat": 4,
"nbformat_minor": 4
}