質問編集履歴
4
えらー
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,9 +20,9 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
|
23
|
+
AttributeError Traceback (most recent call last)
|
24
|
-
|
24
|
+
|
25
|
-
<ipython-input-
|
25
|
+
<ipython-input-51-675d9ee83f23> in <module>
|
26
26
|
|
27
27
|
30 plt.show()
|
28
28
|
|
@@ -32,35 +32,91 @@
|
|
32
32
|
|
33
33
|
|
34
34
|
|
35
|
-
<ipython-input-
|
35
|
+
<ipython-input-51-675d9ee83f23> in DataRead()
|
36
|
-
|
37
|
-
6
|
38
|
-
|
39
|
-
7 def DataRead():
|
40
|
-
|
41
|
-
----> 8 with cd.open("9399_2019.csv", "r", "Shift-JIS", "ignore") as csv_file:
|
42
|
-
|
43
|
-
9 df = pd.read_csv(csv_file, quotechar='"', header=1, index_col=0)
|
44
36
|
|
45
37
|
10
|
46
38
|
|
47
|
-
|
39
|
+
11 df_ = df.copy()
|
40
|
+
|
48
|
-
|
41
|
+
---> 12 df_.index = mdates.date2num(df_.index)
|
42
|
+
|
43
|
+
13 data = df_.reset_index().values
|
44
|
+
|
45
|
+
14
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
-
~/anaconda3/lib/python3.7/code
|
49
|
+
~/anaconda3/lib/python3.7/site-packages/matplotlib/dates.py in date2num(d)
|
50
|
-
|
51
|
-
|
50
|
+
|
52
|
-
|
53
|
-
897 mode = mode + 'b'
|
54
|
-
|
55
|
-
--> 898 file = builtins.open(filename, mode, buffering)
|
56
|
-
|
57
|
-
|
51
|
+
424 if not d.size:
|
58
|
-
|
52
|
+
|
59
|
-
|
53
|
+
425 return d
|
54
|
+
|
60
|
-
|
55
|
+
--> 426 return _to_ordinalf_np_vectorized(d)
|
56
|
+
|
61
|
-
|
57
|
+
427
|
58
|
+
|
62
|
-
|
59
|
+
428
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
~/anaconda3/lib/python3.7/site-packages/numpy/lib/function_base.py in __call__(self, *args, **kwargs)
|
64
|
+
|
65
|
+
2089 vargs.extend([kwargs[_n] for _n in names])
|
66
|
+
|
67
|
+
2090
|
68
|
+
|
69
|
+
-> 2091 return self._vectorize_call(func=func, args=vargs)
|
70
|
+
|
71
|
+
2092
|
72
|
+
|
73
|
+
2093 def _get_ufunc_and_otypes(self, func, args):
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
~/anaconda3/lib/python3.7/site-packages/numpy/lib/function_base.py in _vectorize_call(self, func, args)
|
78
|
+
|
79
|
+
2159 res = func()
|
80
|
+
|
81
|
+
2160 else:
|
82
|
+
|
83
|
+
-> 2161 ufunc, otypes = self._get_ufunc_and_otypes(func=func, args=args)
|
84
|
+
|
85
|
+
2162
|
86
|
+
|
87
|
+
2163 # Convert args to object arrays first
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
~/anaconda3/lib/python3.7/site-packages/numpy/lib/function_base.py in _get_ufunc_and_otypes(self, func, args)
|
92
|
+
|
93
|
+
2119
|
94
|
+
|
95
|
+
2120 inputs = [arg.flat[0] for arg in args]
|
96
|
+
|
97
|
+
-> 2121 outputs = func(*inputs)
|
98
|
+
|
99
|
+
2122
|
100
|
+
|
101
|
+
2123 # Performance note: profiling indicates that -- for simple
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
~/anaconda3/lib/python3.7/site-packages/matplotlib/dates.py in _to_ordinalf(dt)
|
106
|
+
|
107
|
+
224 tzi = UTC
|
108
|
+
|
109
|
+
225
|
110
|
+
|
111
|
+
--> 226 base = float(dt.toordinal())
|
112
|
+
|
113
|
+
227
|
114
|
+
|
115
|
+
228 # If it's sufficiently datetime-like, it will have a `date()` method
|
116
|
+
|
117
|
+
|
118
|
+
|
63
|
-
|
119
|
+
AttributeError: 'str' object has no attribute 'toordinal'
|
64
120
|
|
65
121
|
|
66
122
|
|
@@ -86,7 +142,7 @@
|
|
86
142
|
|
87
143
|
def DataRead():
|
88
144
|
|
89
|
-
with cd.open("9399_2019.csv", "r", "Shift-JIS", "ignore") as csv_file:
|
145
|
+
with cd.open("/Users/super/9399_2019.csv", "r", "Shift-JIS", "ignore") as csv_file:
|
90
146
|
|
91
147
|
df = pd.read_csv(csv_file, quotechar='"', header=1, index_col=0)
|
92
148
|
|
@@ -144,11 +200,7 @@
|
|
144
200
|
|
145
201
|
### 試したこと
|
146
202
|
|
147
|
-
ファイルのパスが間違えていると解釈したのですが、このipynbと同じファイルに入っているので、またしてもつまづいております、、、
|
148
|
-
|
149
|
-
|
203
|
+
大文字小文字やスペルミスがよくある間違いだそうなのでそこを中心に確認しております
|
150
|
-
|
151
|
-
|
152
204
|
|
153
205
|
|
154
206
|
|
3
呼び出しの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -146,6 +146,8 @@
|
|
146
146
|
|
147
147
|
ファイルのパスが間違えていると解釈したのですが、このipynbと同じファイルに入っているので、またしてもつまづいております、、、
|
148
148
|
|
149
|
+
現在進行形で調べながらやっておりますが解決してくださる方がいらっしゃれば教えていただけますと幸いです、、
|
150
|
+
|
149
151
|
|
150
152
|
|
151
153
|
|
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -136,7 +136,7 @@
|
|
136
136
|
|
137
137
|
DataRead()
|
138
138
|
|
139
|
-
|
139
|
+
|
140
140
|
|
141
141
|
```
|
142
142
|
|
1
呼び出しの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,7 +20,49 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
+
FileNotFoundError Traceback (most recent call last)
|
24
|
+
|
25
|
+
<ipython-input-45-6133898395fe> in <module>
|
26
|
+
|
27
|
+
30 plt.show()
|
28
|
+
|
29
|
+
31
|
30
|
+
|
31
|
+
---> 32 DataRead()
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
<ipython-input-45-6133898395fe> in DataRead()
|
36
|
+
|
37
|
+
6
|
38
|
+
|
39
|
+
7 def DataRead():
|
40
|
+
|
41
|
+
----> 8 with cd.open("9399_2019.csv", "r", "Shift-JIS", "ignore") as csv_file:
|
42
|
+
|
43
|
+
9 df = pd.read_csv(csv_file, quotechar='"', header=1, index_col=0)
|
44
|
+
|
45
|
+
10
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
~/anaconda3/lib/python3.7/codecs.py in open(filename, mode, encoding, errors, buffering)
|
50
|
+
|
51
|
+
896 # Force opening of the file in binary mode
|
52
|
+
|
53
|
+
897 mode = mode + 'b'
|
54
|
+
|
55
|
+
--> 898 file = builtins.open(filename, mode, buffering)
|
56
|
+
|
23
|
-
o
|
57
|
+
899 if encoding is None:
|
58
|
+
|
59
|
+
900 return file
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
FileNotFoundError: [Errno 2] No such file or directory: '9399_2019.csv'
|
64
|
+
|
65
|
+
|
24
66
|
|
25
67
|
|
26
68
|
|
@@ -30,9 +72,21 @@
|
|
30
72
|
|
31
73
|
```python
|
32
74
|
|
75
|
+
import pandas as pd
|
76
|
+
|
77
|
+
import matplotlib.pyplot as plt
|
78
|
+
|
79
|
+
import matplotlib.dates as mdates
|
80
|
+
|
81
|
+
import mpl_finance as mpf
|
82
|
+
|
83
|
+
import codecs as cd
|
84
|
+
|
85
|
+
|
86
|
+
|
33
87
|
def DataRead():
|
34
88
|
|
35
|
-
with cd.open("9
|
89
|
+
with cd.open("9399_2019.csv", "r", "Shift-JIS", "ignore") as csv_file:
|
36
90
|
|
37
91
|
df = pd.read_csv(csv_file, quotechar='"', header=1, index_col=0)
|
38
92
|
|
@@ -78,6 +132,10 @@
|
|
78
132
|
|
79
133
|
plt.show()
|
80
134
|
|
135
|
+
|
136
|
+
|
137
|
+
DataRead()
|
138
|
+
|
81
139
|
ソースコード
|
82
140
|
|
83
141
|
```
|
@@ -86,24 +144,16 @@
|
|
86
144
|
|
87
145
|
### 試したこと
|
88
146
|
|
89
|
-
|
90
|
-
|
91
|
-
エラーははい丁寧のでいけてると思うのですが、、
|
92
|
-
|
93
|
-
|
147
|
+
ファイルのパスが間違えていると解釈したのですが、このipynbと同じファイルに入っているので、またしてもつまづいております、、、
|
94
|
-
|
95
|
-
![イメージ説明](0d7db5e852b7268f78490f30a8eeec39.png)
|
96
148
|
|
97
149
|
|
98
150
|
|
99
|
-
|
151
|
+
|
100
152
|
|
101
153
|
|
102
154
|
|
103
155
|
### 補足情報(FW/ツールのバージョンなど)
|
104
156
|
|
105
|
-
https://qiita.com/Nabetalion/items/73b9bd3adec62584ee3a
|
157
|
+
[https://qiita.com/Nabetalion/items/73b9bd3adec62584ee3a]
|
106
|
-
|
107
|
-
|
108
158
|
|
109
159
|
上記サイトを見本として作業しています
|