Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Advanced Python DS Ecosystem" course materials #3

Draft
wants to merge 47 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
50e8272
Add course overview
ccauet Oct 9, 2023
e1dae85
Add DB notebooks
ccauet Oct 9, 2023
bfa40ee
Fix data path
ccauet Oct 9, 2023
bd76b0d
add polars notebooks
jkuehlem Oct 18, 2023
792d457
Update dependencies
ccauet Oct 20, 2023
af812b0
Add object-oriented programming notebook
Oct 21, 2023
da2a63a
Fix some typos and add links to db notebooks in index.
Oct 23, 2023
426e9d3
streamlit example of stromnetz
Oct 23, 2023
d4057fe
Update scipy and statsmodels
ccauet Oct 23, 2023
d059226
Upgrade scikit-learn
ccauet Oct 23, 2023
37612d3
Update project dependencies
ccauet Oct 23, 2023
db71a8d
Update copyright notice
ccauet Oct 23, 2023
c981687
Add copyright notice
ccauet Oct 23, 2023
7345877
Fix relativ path
ccauet Oct 23, 2023
9cee91a
Linting
ccauet Oct 23, 2023
63833b9
Update requirement.txt
ccauet Oct 23, 2023
3b9387d
Remove an incompatible package by hand
ccauet Oct 23, 2023
4664ba3
Create requirements file by hand
ccauet Oct 23, 2023
e659751
Remove python from req file
ccauet Oct 23, 2023
a93828c
No versions constraints
ccauet Oct 23, 2023
dc5475e
Add compose file to setup aux services
ccauet Oct 23, 2023
538043f
Update port mapping
ccauet Oct 23, 2023
048c534
Update MongoDB client to include port and authentication.
Oct 24, 2023
4ddb681
Add polars notebook links to index.
Oct 24, 2023
ce3d77c
Minor changes in polars notebooks.
Oct 24, 2023
839e152
Update dependencies
ccauet Oct 24, 2023
18f0c25
update streamlit example
Oct 24, 2023
92f778a
add streamlit config
Oct 24, 2023
18d2140
add oop and streamlit to index
Oct 24, 2023
59e0f1b
add exercise streamlit
Oct 24, 2023
38ab2b7
fix path to data
Oct 24, 2023
8c6077e
re-add pathlib
Oct 25, 2023
869b536
add licences
Oct 25, 2023
22572c6
Add 'timeit' to polars notebook.
Oct 30, 2023
177334c
Add the current course index to the first level and update paths acco…
Oct 30, 2023
f99fb8d
Add type hints to OOD notebook.
Oct 30, 2023
8451101
add output of db schema information
Nov 13, 2023
f35f3ff
Fix some typos and remove unnecessary lines of code from polars noteb…
Nov 24, 2023
befd5b2
Remove duplicated index, update paths in ape-index, update polars int…
Nov 24, 2023
8347d06
Add APE to official data-science-learning-paths index.
Nov 24, 2023
5040f00
Rework polars notebooks. Split in exercise and solution and add a 'be…
Nov 24, 2023
ae78aaf
Delete old polars notebook.
Nov 24, 2023
591b4ae
Try to use black format in polars notebooks.
Nov 24, 2023
8e47f5b
Add more information for the DB-API sqlite notebook and update the in…
Nov 24, 2023
dd10538
Add introductory text for ORM notebook.
Nov 24, 2023
55ba215
Add introductory text for NoSQL notebook with MongoDB.
Nov 24, 2023
8a525ad
Minor update in pandas-sql notebook.
Nov 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
re-add pathlib
sdungs committed Oct 25, 2023
commit 8c6077eb045f1c6c975cd43727bc9dfe69962512
8 changes: 6 additions & 2 deletions notebooks/streamlit/example_stromnetz/Overview.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# This code is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/).
# Copyright © [Point 8 GmbH](https://point-8.de)

import streamlit as st
import io
from PIL import Image
import base64
import pathlib

def add_logo():
file = open("./static/neps.png", "rb")
file = open(pathlib.Path(__file__).parent / "static/neps.png", "rb")
contents = file.read()
img_str = base64.b64encode(contents).decode("utf-8")
buffer = io.BytesIO()
@@ -32,5 +36,5 @@ def add_logo():

add_logo()

image = Image.open('static/energy.png')
image = Image.open(pathlib.Path(__file__).parent / "static/energy.png")
st.image(image)
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This code is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/).
# Copyright © [Point 8 GmbH](https://point-8.de)
import pathlib
from turtle import color
import streamlit as st
import pandas as pd
@@ -15,8 +18,13 @@

with tab_a4:
st.markdown("### Übersicht über die Verteilung der installierten Leistungen je Energieträger")

df_c2_a4 = pd.read_excel("../data/Kapitel_2_Daten_NEP_2037_V2023_2_Entwurf.xlsx", sheet_name="Abbildung 4", header=2,index_col=0).dropna()
df_c2_a4 = pd.read_excel(
pathlib.Path(__file__).parent.parent.parent
/ "data/Kapitel_2_Daten_NEP_2037_V2023_2_Entwurf.xlsx",
sheet_name="Abbildung 4",
header=2,
index_col=0,
).dropna()
st.dataframe(df_c2_a4)


@@ -45,14 +53,19 @@

with tab_a11:
st.markdown("### Mittlerer, minimaler und maximaler Flexibilitätseinsatz je Tagesstunde in Szenario B 2037")
df_c2_a11 = pd.read_excel("../data/Kapitel_2_Daten_NEP_2037_V2023_2_Entwurf.xlsx", sheet_name="Abbildung 11", skiprows=4,index_col=0)
df_c2_a11 = pd.read_excel(
pathlib.Path(__file__).parent.parent.parent
/ "data/Kapitel_2_Daten_NEP_2037_V2023_2_Entwurf.xlsx",
sheet_name="Abbildung 11",
skiprows=4,
index_col=0,
)
col_names = ["Einheit", 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]
df_c2_a11.columns = col_names

st.dataframe(df_c2_a11)

df_c2_a11_plot = df_c2_a11.drop("Einheit", axis=1).transpose()
#st.dataframe(df_c2_a11_plot)

figX, ax = plt.subplots()
ax.plot(df_c2_a11_plot.index, df_c2_a11_plot['Flexibilitätseinsatz - Median'], ".", label="median")
@@ -77,7 +90,13 @@
with tab_a14:
st.markdown("### Installierte Leistungen je Bundesland im Szenario A 2037")

df_c2_a14 = pd.read_excel("../data/Kapitel_2_Daten_NEP_2037_V2023_2_Entwurf.xlsx", sheet_name="Abbildung 14", skiprows=2,index_col=0).dropna()
df_c2_a14 = pd.read_excel(
pathlib.Path(__file__).parent.parent.parent
/ "data/Kapitel_2_Daten_NEP_2037_V2023_2_Entwurf.xlsx",
sheet_name="Abbildung 14",
skiprows=2,
index_col=0,
).dropna()
st.dataframe(df_c2_a14)

df_c2_a14_w = df_c2_a14.copy().drop(['Band der Nachfrage***', 'Unnamed: 11', 'PtH','PtG ****', 'DSM'], axis=1).drop(["Summe**"])
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This code is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/).
# Copyright © [Point 8 GmbH](https://point-8.de)

import streamlit as st

from Overview import add_logo