Skip to content

Commit

Permalink
lecture 7 link
Browse files Browse the repository at this point in the history
  • Loading branch information
vitekzkytek committed Mar 30, 2021
1 parent a6113ab commit be78186
Show file tree
Hide file tree
Showing 3 changed files with 228 additions and 2,379 deletions.
86 changes: 64 additions & 22 deletions 06_seminar/exercises.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -36,12 +36,21 @@
"source": [
"### 1a. Request Quandl for time series `FB` from `WIKI` database. Use JSON format.\n",
"\n",
"Hint: https://www.quandl.com/api/v3/datasets/{QUANDL_DATABASE}/{QUANDL_DATASET}/data.{DATA_FORMAT}?api_key={YOUR-QUANDL-API-KEY}"
"Hint: https://www.quandl.com/api/v3/datasets/{QUANDL_DATABASE}/{QUANDL_DATASET}/data.{DATA_FORMAT}?api_key={YOUR-QUANDL-API-KEY}\n",
"\n",
"Use GET"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
Expand All @@ -57,7 +66,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
Expand All @@ -80,6 +89,20 @@
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -115,6 +138,13 @@
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -203,7 +233,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -213,12 +243,13 @@
"\n",
" Make sure that the request object is parsed as UTF-8 string.\n",
" '''\n",
" r = requests.get(link,encoding='UTF-8')\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -231,13 +262,14 @@
" The URLs are expected in absolute format, i.e. including a full domain.\n",
" '''\n",
" pass\n",
"\n",
" "
" \n",
"news_links = get_all_news_links('https://ies.fsv.cuni.cz/content/tree/index/lang/en')\n",
"news_links"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -250,22 +282,21 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def parse_date(soup):\n",
" '''\n",
" Parse text of the sibling of sibling of the first h3 element in the soup. Note that the immidiate sibling of `h3` is not Tag element, but NavigableString. This is used to represent text between tags.\n",
" '''\n",
"\n",
" pass\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -277,13 +308,15 @@
"\n",
" Hint: Consider using a `.join()` function applicable on string object\n",
" '''\n",
"\n",
" pass"
" \n",
" pass\n",
" \n",
"print(parse_news_content(get_soup('https://ies.fsv.cuni.cz/en/news/4976')))"
]
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -298,23 +331,33 @@
"\n",
" time.sleep(pause)\n",
" \n",
" pass"
" pass\n",
" \n",
"parse_ies_news('https://ies.fsv.cuni.cz/en/news/4976')"
]
},
{
"cell_type": "code",
"execution_count": 62,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def get_all_news(link):\n",
" '''\n",
" wraping fuctions that accepts a `link` pointing towards hub website with links to parse and returing a dataframe containing all the links\n",
" wraping fuction that accepts a `link` pointing towards hub website with links to parse and returing a dataframe containing all the links\n",
" '''\n",
"\n",
" pass"
" \n",
" pass\n",
"df = get_all_news('https://ies.fsv.cuni.cz/content/tree/index/lang/en')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -340,8 +383,7 @@
" pass\n",
"\n",
"\n",
"dl = Downloader('https://ies.fsv.cuni.cz/content/tree/index/lang/en')\n",
"dl.df"
"#dl = Downloader('https://ies.fsv.cuni.cz/content/tree/index/lang/en')\n"
]
},
{
Expand Down
2,519 changes: 163 additions & 2,356 deletions 07_Pandas/lecture7.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Data Processing in Python (JEM207)
The seminar on Monday March 29th will be held online on the following Google Meet: meet.google.com/mqh-quhp-wsj
The lecture on Tuesday March 30rd will be held online on the following Google Meet: meet.google.com/kvo-hgyp-crb

The course site for the Data Processing in Python from [IES](http://ies.fsv.cuni.cz/). See information on [SIS](https://is.cuni.cz/studium/predmety/index.php?do=predmet&kod=JEM207). The course is taught by [Martin Hronec](mailto:martin.hronec@fsv.cuni.cz), [Vítek Macháček](mailto:vit.machacek@cerge-ei.cz) and [Jan Šíla](mailto:jan.sila@fsv.cuni.cz).

Expand Down

0 comments on commit be78186

Please sign in to comment.