Spaces:
Runtime error
Runtime error
Hanna Prutsakova
commited on
Commit
•
4ff8613
1
Parent(s):
ac063c7
fix
Browse files- test.ipynb +69 -16
test.ipynb
CHANGED
@@ -28,13 +28,12 @@
|
|
28 |
]
|
29 |
},
|
30 |
{
|
31 |
-
"cell_type": "
|
32 |
-
"
|
33 |
-
"id": "ac059883",
|
34 |
"metadata": {},
|
35 |
-
"outputs": [],
|
36 |
"source": [
|
37 |
-
"
|
|
|
38 |
]
|
39 |
},
|
40 |
{
|
@@ -125,7 +124,7 @@
|
|
125 |
"execution_count": 6,
|
126 |
"id": "chief-dream",
|
127 |
"metadata": {
|
128 |
-
"scrolled":
|
129 |
},
|
130 |
"outputs": [
|
131 |
{
|
@@ -144,11 +143,21 @@
|
|
144 |
"df.Date = pd.to_datetime(df.Date)"
|
145 |
]
|
146 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
{
|
148 |
"cell_type": "code",
|
149 |
"execution_count": 7,
|
150 |
"id": "arbitrary-alexandria",
|
151 |
-
"metadata": {
|
|
|
|
|
152 |
"outputs": [
|
153 |
{
|
154 |
"ename": "NameError",
|
@@ -163,7 +172,7 @@
|
|
163 |
}
|
164 |
],
|
165 |
"source": [
|
166 |
-
"fig = px.line(df, x='Date', y='High'
|
167 |
"\n",
|
168 |
"fig.update_xaxes(\n",
|
169 |
" rangeselector=dict(\n",
|
@@ -178,11 +187,21 @@
|
|
178 |
"fig.show()"
|
179 |
]
|
180 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
{
|
182 |
"cell_type": "code",
|
183 |
"execution_count": 8,
|
184 |
"id": "cleared-potential",
|
185 |
-
"metadata": {
|
|
|
|
|
186 |
"outputs": [
|
187 |
{
|
188 |
"ename": "NameError",
|
@@ -197,7 +216,7 @@
|
|
197 |
}
|
198 |
],
|
199 |
"source": [
|
200 |
-
"fig = px.area(df, x='Date', y='Close'
|
201 |
"\n",
|
202 |
"fig.update_xaxes(\n",
|
203 |
" rangeselector=dict(\n",
|
@@ -212,11 +231,21 @@
|
|
212 |
"fig.show()"
|
213 |
]
|
214 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
{
|
216 |
"cell_type": "code",
|
217 |
"execution_count": 9,
|
218 |
"id": "adopted-preliminary",
|
219 |
-
"metadata": {
|
|
|
|
|
220 |
"outputs": [
|
221 |
{
|
222 |
"name": "stdout",
|
@@ -238,7 +267,6 @@
|
|
238 |
}
|
239 |
],
|
240 |
"source": [
|
241 |
-
"print(\"Bar plot. Rising value colored red, dropping value colored green.\")\n",
|
242 |
"df3 = df.drop(['Open', 'Adj Close', 'Low', 'Close', 'Volume'], axis=1)\n",
|
243 |
"colors = ['red' if df3['High'][i+1] < df3['High'][i] else 'green' for i in range(len(df3)-1)]\n",
|
244 |
"\n",
|
@@ -257,6 +285,14 @@
|
|
257 |
"fig2.show()"
|
258 |
]
|
259 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
{
|
261 |
"cell_type": "code",
|
262 |
"execution_count": 10,
|
@@ -276,15 +312,25 @@
|
|
276 |
}
|
277 |
],
|
278 |
"source": [
|
279 |
-
"fig = px.box(df, y=\"Adj Close\"
|
280 |
"fig.show()"
|
281 |
]
|
282 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
{
|
284 |
"cell_type": "code",
|
285 |
"execution_count": 11,
|
286 |
"id": "derived-colorado",
|
287 |
-
"metadata": {
|
|
|
|
|
288 |
"outputs": [
|
289 |
{
|
290 |
"ename": "NameError",
|
@@ -299,7 +345,6 @@
|
|
299 |
}
|
300 |
],
|
301 |
"source": [
|
302 |
-
"print(\"Ohlc plot. Rising value colored red, dropping value colored green.\")\n",
|
303 |
"fig3 = go.Figure(data=go.Ohlc(x=df['Date'],\n",
|
304 |
" open=df['Open'],\n",
|
305 |
" high=df['High'],\n",
|
@@ -318,6 +363,14 @@
|
|
318 |
"fig3.show()"
|
319 |
]
|
320 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
{
|
322 |
"cell_type": "code",
|
323 |
"execution_count": null,
|
@@ -325,7 +378,7 @@
|
|
325 |
"metadata": {},
|
326 |
"outputs": [],
|
327 |
"source": [
|
328 |
-
"fig = px.scatter_matrix(df
|
329 |
"fig.show()"
|
330 |
]
|
331 |
},
|
|
|
28 |
]
|
29 |
},
|
30 |
{
|
31 |
+
"cell_type": "markdown",
|
32 |
+
"id": "3d7bc559",
|
|
|
33 |
"metadata": {},
|
|
|
34 |
"source": [
|
35 |
+
"# Stock exchange prices visualization\n",
|
36 |
+
"## File should contain: Date, Open, High, Low, Close, Adj Close, Volume"
|
37 |
]
|
38 |
},
|
39 |
{
|
|
|
124 |
"execution_count": 6,
|
125 |
"id": "chief-dream",
|
126 |
"metadata": {
|
127 |
+
"scrolled": true
|
128 |
},
|
129 |
"outputs": [
|
130 |
{
|
|
|
143 |
"df.Date = pd.to_datetime(df.Date)"
|
144 |
]
|
145 |
},
|
146 |
+
{
|
147 |
+
"cell_type": "markdown",
|
148 |
+
"id": "bcbc4487",
|
149 |
+
"metadata": {},
|
150 |
+
"source": [
|
151 |
+
"### Line graph of High"
|
152 |
+
]
|
153 |
+
},
|
154 |
{
|
155 |
"cell_type": "code",
|
156 |
"execution_count": 7,
|
157 |
"id": "arbitrary-alexandria",
|
158 |
+
"metadata": {
|
159 |
+
"scrolled": true
|
160 |
+
},
|
161 |
"outputs": [
|
162 |
{
|
163 |
"ename": "NameError",
|
|
|
172 |
}
|
173 |
],
|
174 |
"source": [
|
175 |
+
"fig = px.line(df, x='Date', y='High')\n",
|
176 |
"\n",
|
177 |
"fig.update_xaxes(\n",
|
178 |
" rangeselector=dict(\n",
|
|
|
187 |
"fig.show()"
|
188 |
]
|
189 |
},
|
190 |
+
{
|
191 |
+
"cell_type": "markdown",
|
192 |
+
"id": "46ef20e7",
|
193 |
+
"metadata": {},
|
194 |
+
"source": [
|
195 |
+
"### Area graph of Close"
|
196 |
+
]
|
197 |
+
},
|
198 |
{
|
199 |
"cell_type": "code",
|
200 |
"execution_count": 8,
|
201 |
"id": "cleared-potential",
|
202 |
+
"metadata": {
|
203 |
+
"scrolled": true
|
204 |
+
},
|
205 |
"outputs": [
|
206 |
{
|
207 |
"ename": "NameError",
|
|
|
216 |
}
|
217 |
],
|
218 |
"source": [
|
219 |
+
"fig = px.area(df, x='Date', y='Close')\n",
|
220 |
"\n",
|
221 |
"fig.update_xaxes(\n",
|
222 |
" rangeselector=dict(\n",
|
|
|
231 |
"fig.show()"
|
232 |
]
|
233 |
},
|
234 |
+
{
|
235 |
+
"cell_type": "markdown",
|
236 |
+
"id": "8b5738fb",
|
237 |
+
"metadata": {},
|
238 |
+
"source": [
|
239 |
+
"### Bar plot. Rising value colored red, dropping value colored green."
|
240 |
+
]
|
241 |
+
},
|
242 |
{
|
243 |
"cell_type": "code",
|
244 |
"execution_count": 9,
|
245 |
"id": "adopted-preliminary",
|
246 |
+
"metadata": {
|
247 |
+
"scrolled": true
|
248 |
+
},
|
249 |
"outputs": [
|
250 |
{
|
251 |
"name": "stdout",
|
|
|
267 |
}
|
268 |
],
|
269 |
"source": [
|
|
|
270 |
"df3 = df.drop(['Open', 'Adj Close', 'Low', 'Close', 'Volume'], axis=1)\n",
|
271 |
"colors = ['red' if df3['High'][i+1] < df3['High'][i] else 'green' for i in range(len(df3)-1)]\n",
|
272 |
"\n",
|
|
|
285 |
"fig2.show()"
|
286 |
]
|
287 |
},
|
288 |
+
{
|
289 |
+
"cell_type": "markdown",
|
290 |
+
"id": "b008b4c1",
|
291 |
+
"metadata": {},
|
292 |
+
"source": [
|
293 |
+
"### Box plot of Adj Close"
|
294 |
+
]
|
295 |
+
},
|
296 |
{
|
297 |
"cell_type": "code",
|
298 |
"execution_count": 10,
|
|
|
312 |
}
|
313 |
],
|
314 |
"source": [
|
315 |
+
"fig = px.box(df, y=\"Adj Close\")\n",
|
316 |
"fig.show()"
|
317 |
]
|
318 |
},
|
319 |
+
{
|
320 |
+
"cell_type": "markdown",
|
321 |
+
"id": "323dba84",
|
322 |
+
"metadata": {},
|
323 |
+
"source": [
|
324 |
+
"### Ohlc plot. Rising value colored red, dropping value colored green."
|
325 |
+
]
|
326 |
+
},
|
327 |
{
|
328 |
"cell_type": "code",
|
329 |
"execution_count": 11,
|
330 |
"id": "derived-colorado",
|
331 |
+
"metadata": {
|
332 |
+
"scrolled": true
|
333 |
+
},
|
334 |
"outputs": [
|
335 |
{
|
336 |
"ename": "NameError",
|
|
|
345 |
}
|
346 |
],
|
347 |
"source": [
|
|
|
348 |
"fig3 = go.Figure(data=go.Ohlc(x=df['Date'],\n",
|
349 |
" open=df['Open'],\n",
|
350 |
" high=df['High'],\n",
|
|
|
363 |
"fig3.show()"
|
364 |
]
|
365 |
},
|
366 |
+
{
|
367 |
+
"cell_type": "markdown",
|
368 |
+
"id": "04a2404e",
|
369 |
+
"metadata": {},
|
370 |
+
"source": [
|
371 |
+
"### Matrix of scatter plots"
|
372 |
+
]
|
373 |
+
},
|
374 |
{
|
375 |
"cell_type": "code",
|
376 |
"execution_count": null,
|
|
|
378 |
"metadata": {},
|
379 |
"outputs": [],
|
380 |
"source": [
|
381 |
+
"fig = px.scatter_matrix(df)\n",
|
382 |
"fig.show()"
|
383 |
]
|
384 |
},
|