-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_df.py
43 lines (32 loc) · 1009 Bytes
/
create_df.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import pandas as pd
from app.utils import get_df
def create_df():
url = "https://ws.ujep.cz/ws/services/rest2/programy/getStudijniProgramy"
vars = {
"pouzePlatne": True,
"jazyk": "CZ",
"lang": "cs",
"outputFormat": "CSV",
"outputFormatEncoding": "utf-8",
}
df = get_df(url, vars)
# df.dropna(subset=["garant"], inplace=True)
# df = df.loc[df["vykazovan"] == "A"]
url = "https://ws.ujep.cz/ws/services/rest2/programy/getOboryStudijnihoProgramu"
tmp = [
get_df(
url,
{
"stprIdno": stprIdno,
"lang": "cs",
"outputFormat": "CSV",
"outputFormatEncoding": "utf-8",
},
)
for stprIdno in df["stprIdno"]
]
df = pd.concat(tmp)
df = df.sort_values(by=['platnyOd'], ascending=False)
df = df.drop_duplicates(subset=['nazevProgramu', "typ", "forma"])
df.to_csv("df.csv", index=False)
create_df()