...
- Datacamp.com: Good, beginner-friendly and interactive courses on R (and Python). Very recommended - also check out my own course :-)
KEV
Kontext:
Datensatz (Ausschnitt):
https://docs.google.com/spreadsheets/d/1c6A356Eg9zDX3dkYGGvDJuzfpmSgHnp-Zf7ucSodYRA/edit?usp=sharing
Sind folgende Auswertungen / Applikationen mit dem Datensatz möglich?
- Falls ja, wie würdet Ihr vorgehen?
- Falls nein, wieso nicht?
- Durchschnittliche Vertragslänge (Inbetriebnahme bis Vertragsende)
- Gesamtstromproduktion nach Kanton
- Gesamtsumme der Geldbezüge für einerseits Herren, andererseits Frauen
- Durchschnittliche Länge der Strassennamen nach Kanton
Exercise solutions day 1
- Manillio:
- Browse https://developer.spotify.com/console/get-search-item/ to get his ID: 7uxtLjuqkJ3cnjQQuW6Cul
- Browse https://developer.spotify.com/console/get-artist-top-tracks/, fill in values and get JSON data
- Copy and paste into https://json-csv.com/
- Download as Excel - do the math (36.60705 min)
- Take-Aways:
- Sometimes, data is accessible via an API
- The preferred data format of APIs is JSON
- JSON can be converted into CSV
- The preferred way of talking to an API is with code
- Wasserstation Tiefenbrunnen
- First approach: Scraping data
- Browse https://www.tecson-data.ch/zurich/tiefenbrunnen/index.php (as probably shown on Google)
- Select “windchill”, 2.11.2018/7.11.2018 and “all values” at the very bottom
- Copy stuff into Excel by hand and calculate median
- Second approach: Open Data Zürich / API:
- Browse https://tecdottir.herokuapp.com/docs/#/measurements
- Enter parameters
- Copy curl string and pipe into a file
- Upload JSON and paste into https://json-csv.com/ (bonus: use matrix style)
- Download CSV, open in Excel and calculate median (don’t forget to filter unneeded dates)
- Take-Aways:
- Copying and pasting stuff from HTML tables should be avoided
- Always look out for an API
- Try out different settings of your tools - they might bring you better results (“matrix style”)
- Get to know the terminal
- Excel / LibreOffice / OpenOffice have some good filters: get to know how to use them
- If you run out of queries, delete cookies
- Schlichtungsverfahren
- Google it and go to https://www.bwo.admin.ch/bwo/de/home/mietrecht/schlichtungsbehoerden/statistik-der-schlichtungsverfahren.html
- Download first PDF
- Download Tabula and launch, upload PDF (or use Adobe Reader DC)
- Select last table, lattice extraction format
- Download as CSV
- Open in LibreOffice and make chart
- Take-Aways:
- Many interesting data are buried in PDFs
- Use proprietary software or Tabula to extract the data