Skip to content

Commit f4239d2

Browse files
multiple updates to structure
1 parent a44f6fe commit f4239d2

File tree

109 files changed

+1196
-7074
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1196
-7074
lines changed

general/faq.qmd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,11 @@ If you have a question that is not answered here, please let me know by sending
1717
If you have found a mistake in the course material or if you have any suggestion on how to improve the course, please let me know in the [following form](https://tally.so/r/w7oapa) or by creating an issue on [GitHub](https://github.com/beyondsimulations/Introduction-to-Python/issues).
1818

1919
## FAQs
20-
So far, I haven't received any questions.
20+
21+
### How can I download PDF slides from the lecture?
22+
23+
1. First, open the lecture you want to download the slides from.
24+
2. Then, click on the `RevealJS` button in the top right corner.
25+
3. Now, click on the three stacked bars in the lower left corner.
26+
4. Then, click on `Tools` in the upper left corner.
27+
5. Now you can select `PDF Export Mode` and then save the slides as a PDF.

part-01/lecture-introduction.qmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ format:
2424
output-file: lecture-presentation.html
2525
html:
2626
theme: [litera, ../styles_html.scss]
27-
pdf:
28-
documentclass: report
2927
---
3028

3129
# [About this Course]{.flow} {.title}

part-02/lecture-control.qmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ format:
2626
output-file: lecture-control-presentation.html
2727
html:
2828
theme: [litera, ../styles_html.scss]
29-
pdf:
30-
documentclass: report
3129
---
3230

3331
# [Quick Recap of the last Lecture]{.flow} {.title}

part-03/lecture-functions.qmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ format:
2626
output-file: lecture-functions-presentation.html
2727
html:
2828
theme: [litera, ../styles_html.scss]
29-
pdf:
30-
documentclass: report
3129
---
3230

3331
# [Quick Recap of the last Lecture]{.flow} {.title}

part-04/lecture-dimensions.qmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ format:
2525
output-file: lecture-dimensions-presentation.html
2626
html:
2727
theme: [litera, ../styles_html.scss]
28-
pdf:
29-
documentclass: report
3028
---
3129

3230
# [Quick Recap of the last Lecture]{.flow} {.title}

part-05/lecture-errors.qmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ format:
2626
output-file: lecture-errors-presentation.html
2727
html:
2828
theme: [litera, ../styles_html.scss]
29-
pdf:
30-
documentclass: report
3129
---
3230

3331
# [Quick Recap of the last Lecture]{.flow} {.title}

part-06/lecture-modules.qmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ format:
2626
output-file: lecture-modules-presentation.html
2727
html:
2828
theme: [litera, ../styles_html.scss]
29-
pdf:
30-
documentclass: report
3129
---
3230

3331
# [Quick Recap of the last Lecture]{.flow} {.title}

part-07/lecture-scientific.qmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ format:
2626
output-file: lecture-scientific-presentation.html
2727
html:
2828
theme: [litera, ../styles_html.scss]
29-
pdf:
30-
documentclass: report
3129
---
3230

3331
# [Quick Recap of the last Lecture]{.flow} {.title}

part-08/lecture-pandas.qmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ format:
2626
output-file: lecture-pandas-presentation.html
2727
html:
2828
theme: [litera, ../styles_html.scss]
29-
pdf:
30-
documentclass: report
3129
---
3230

3331
# [Quick Recap of the last Lecture]{.flow} {.title}

part-09/dashboards/stocks_dash.py

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import yfinance as yf
2+
import pandas as pd
3+
import dash
4+
from dash import dcc, html
5+
from dash.dependencies import Input, Output
6+
import plotly.graph_objects as go
7+
from datetime import datetime, timedelta
8+
import pytz
9+
10+
# Initialize the Dash app
11+
app = dash.Dash(__name__)
12+
13+
# Get Remedy stock data
14+
stock = yf.Ticker("REMEDY.HE")
15+
df = stock.history(period="2y") # Get 2 years of data
16+
17+
# Create the app layout
18+
app.layout = html.Div([
19+
html.H1('Remedy Entertainment Stock Analysis',
20+
style={'textAlign': 'center', 'color': '#2c3e50', 'marginTop': '20px'}),
21+
22+
# Time range selector
23+
dcc.RadioItems(
24+
id='timeframe',
25+
options=[
26+
{'label': '1M', 'value': 30},
27+
{'label': '3M', 'value': 90},
28+
{'label': '6M', 'value': 180},
29+
{'label': '2Y', 'value': 730},
30+
{'label': '1Y', 'value': 365},
31+
],
32+
value=180,
33+
inline=True,
34+
style={'textAlign': 'center', 'marginBottom': '20px'}
35+
),
36+
37+
# Candlestick chart
38+
dcc.Graph(id='stock-graph')
39+
])
40+
41+
# Callback to update the graph based on timeframe selection
42+
@app.callback(
43+
Output('stock-graph', 'figure'),
44+
Input('timeframe', 'value')
45+
)
46+
def update_graph(selected_days):
47+
filtered_df = df.copy()
48+
49+
if selected_days == 'ytd':
50+
start_date = datetime(datetime.now().year, 1, 1)
51+
filtered_df = df[df.index >= start_date]
52+
else:
53+
# Filter last N days
54+
filtered_df = df.iloc[-selected_days:]
55+
56+
# Create the candlestick chart
57+
fig = go.Figure(data=[go.Candlestick(x=filtered_df.index,
58+
open=filtered_df['Open'],
59+
high=filtered_df['High'],
60+
low=filtered_df['Low'],
61+
close=filtered_df['Close'],
62+
name='REMEDY')])
63+
64+
# Add volume bars
65+
fig.add_trace(go.Bar(x=filtered_df.index,
66+
y=filtered_df['Volume'],
67+
name='Volume',
68+
yaxis='y2',
69+
marker_color='rgba(128,128,128,0.5)'))
70+
71+
# Update layout
72+
fig.update_layout(
73+
title='Remedy Entertainment (REMEDY.HE)',
74+
yaxis_title='Stock Price (EUR)',
75+
yaxis2=dict(
76+
title='Volume',
77+
overlaying='y',
78+
side='right'
79+
),
80+
xaxis_rangeslider_visible=False,
81+
template='plotly_white',
82+
height=800
83+
)
84+
85+
return fig
86+
87+
# Run the app
88+
if __name__ == '__main__':
89+
app.run_server(debug=True)

0 commit comments

Comments
 (0)