質問編集履歴
1
code
test
CHANGED
File without changes
|
test
CHANGED
@@ -87,3 +87,49 @@
|
|
87
87
|
TXG|xx|xx||
|
88
88
|
|
89
89
|
YI|xx|xx||
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
```ここに言語を入力
|
94
|
+
|
95
|
+
start1 = '2020-07-11'
|
96
|
+
|
97
|
+
end2= '2020-07-13'
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
def get_val(data, company, date):
|
104
|
+
|
105
|
+
try:
|
106
|
+
|
107
|
+
return data.DataReader(company, 'yahoo', date,date).Close.sum()
|
108
|
+
|
109
|
+
except KeyError:
|
110
|
+
|
111
|
+
pass
|
112
|
+
|
113
|
+
return 0
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
for i in companies_TEST:
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
print(i + " done!")
|
124
|
+
|
125
|
+
df_NYSE.at[str(i),"2020-07-10"] =get_val(str(i), 'yahoo', start1,start1).Close.sum()
|
126
|
+
|
127
|
+
df_NYSE.at[str(i),"2020-07-13"] =get_val(str(i), 'yahoo', end2,end2).Close.sum()
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
print("ALL done!")
|
134
|
+
|
135
|
+
```
|