Skip to content
Snippets Groups Projects
Commit 2e8dcbfd authored by Antti Hakkinen's avatar Antti Hakkinen
Browse files

edit course excercise phase 2 instructions

parent 97578669
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
## Harjoitustyö
%% Cell type:markdown id: tags:
### Vaihe 1:
%% Cell type:markdown id: tags:
#### Hae Digitrafficin REST-rajapintapalvelusta (JSON-formaatissa) aktiiviset junat pääteosoitteella `/live-trains` Helsingin asemalta, joiden hakuparametrit ovat seuraavat:
* arrived_trains=10
* departed_trains=10
* include_nonstopping=False
#### Tämän jälkeen lue kyseinen data Pandasin dataframeen ilman muokkaamista, jolloin sarakkeiden otsikot ovat seuraavanlaiset:
`cancelled`,
`commuterLineID`,
`departureDate`,
`operatorShortCode`,
`operatorUICCode`,
`runningCurrently`,
`timeTableRows`,
`timetableAcceptanceDate`,
`timetableType`,
`trainCategory`,
`trainNumber`,
`trainType`,
`version`
%% Cell type:code id: tags:
``` python
#
```
%% Cell type:markdown id: tags:
#### Poista kaikki muut sarakkeet paitsi `timeTableRows` ja `trainNumber`
%% Cell type:code id: tags:
``` python
#
```
%% Cell type:markdown id: tags:
#### Tämän jälkeen pura `timeTableRows` sarakkeen arvot jokaisesta junasta erikseen (sarakkeen arvo jokaiselle junalle sisältää useampia JSON-objekteja) ja lisää dataan mukaan junan tiedot yksilöivä `trainNumber`
%% Cell type:code id: tags:
``` python
#
```
%% Cell type:markdown id: tags:
#### Pudota sitten seuraavat sarakkeet datasta: `causes`, `estimateSource`, `liveEstimateTime`, `differenceInMinutes`, `commercialStop` ja `trainReady`
%% Cell type:code id: tags:
``` python
#
```
%% Cell type:markdown id: tags:
#### Täytä jokaisen rivin sarakkeen `actualTime` puuttuvat arvot `scheduledTime` -sarakkeen arvolla.
%% Cell type:code id: tags:
``` python
#
```
%% Cell type:markdown id: tags:
### Vaihe 2:
#### Pura tämän kansion sisällä olevan `data.html` -tiedoston `table`-elementin solujen arvot käyttäen regex-syntaksia ja yhdistä ne vaiheessa 1 luotuun dataframeen.
#### Pura tämän kansion sisällä olevan `data.html` -tiedoston `table`-elementin solujen arvot käyttäen regex-syntaksia ja yhdistä ne vaiheessa 1 luotuun dataframeen. Huom: tehtävässä tulee käyttää vain regexiä (Esim. Pandasin read_html()-metodin käyttö on kielletty)!
%% Cell type:code id: tags:
``` python
#
```
%% Cell type:markdown id: tags:
### Vaihe 3:
#### Tee SQLite tietokanta ja lisää sinne vaiheessa 2 luotu dataframe.
%% Cell type:code id: tags:
``` python
#
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment