Making Open Weather Data More Accessible: Extracting Seasonal Insights from Singapore Weather Station Data Presented by: Ong Chin Hwee (@ongchinhwee) 1 December 2019

About me Ong Chin Hwee 王敬惠 ● Data Engineer @ ST Engineering ● Background in aerospace engineering + computational modelling ● Loves (and contributes to) pandas ● Mentor team at BigDataX, one of the Top 10 Data Communities in Singapore @ongchinhwee

Singapore 新加坡: 1°17’22.81”N, 103°51’0.25”E 北纬1度,经纬103度 @ongchinhwee

105° 0° @ongchinhwee

A year is usually split into four seasons… 常說一年划分为四季。。。 @ongchinhwee

春 Spring @ongchinhwee

春 Spring 夏 Summer @ongchinhwee

春 Spring 夏 Summer 秋 Autumn @ongchinhwee

春 Spring 夏 Summer 秋 Autumn 冬 Winter @ongchinhwee

…how about my home country? 。。。新加坡有多少季節? @ongchinhwee

Are the “four seasons” just… @ongchinhwee

Are the “four seasons” just… 1. Hot 熱 2. Very Hot 很熱 3. Extremely Hot 超熱 4. Rain? 雨 @ongchinhwee

Let’s discover seasons through data. 讓我們以數據來發掘季節。 @ongchinhwee

Extracting Weather Data @ongchinhwee

Data.gov.sg - Singapore’s Open Data Portal 新加坡開源數據平台 @ongchinhwee

Realtime Weather Readings across Singapore Real-time API (Application Programming Interface) on Data.gov.sg (Singapore’s open data portal) 即時應用程式介面 @ongchinhwee

Realtime Weather Readings across Singapore Real-time API on Data.gov.sg (Singapore’s open data portal) Open government data available under the Singapore Open Data License 政府開放資料 @ongchinhwee

Realtime Weather Readings across Singapore Real-time API on Data.gov.sg (Singapore’s open data portal) Open government data available under the Singapore Open Data License Minute-by-minute weather station readings @ongchinhwee

“Let’s try to scrap weather data for a specific weather station!” @ongchinhwee

“Let’s try to scrap weather data for a specific weather station!” “How about we scrap month-long data from the API?” @ongchinhwee

@ongchinhwee

@ongchinhwee

@ongchinhwee

Nested JSON format! @ongchinhwee

@ongchinhwee

😰 @ongchinhwee

Open Data = Available 開放資料 = 任何人都能取得 @ongchinhwee

Open Data = Accessible? 開放資料 = 任何人都能使用? @ongchinhwee

“The data must be available as a whole and at no more than a reasonable reproduction cost…The data must also be available in a convenient and modifiable form.” - Open Knowledge Foundation @ongchinhwee

Open Data - Available, Readable, Accessible Available: Open data is freely available for everyone to access and use without restrictions or exorbitant costs. @ongchinhwee

Open Data - Available, Readable, Accessible Available: Open data is freely available for everyone to access and use without restrictions or exorbitant costs. Readable: Open data is more usable when it is shared in a machine-readable format such as JSON @ongchinhwee

Open Data - Available, Readable, Accessible Available: Open data is freely available for everyone to access and use without restrictions or exorbitant costs. Readable: Open data is more usable when it is shared in a machine-readable format such as JSON Accessible: Open data is only useful if it’s shared in a way that everyone can easily discover and understand. @ongchinhwee

If not everyone can understand how to use the available data, is the data really open? @ongchinhwee

💭 @ongchinhwee

💡 @ongchinhwee

I ended up creating my own scraping tool. @ongchinhwee

“Scraping Meteorological Data from Data.gov.sg APIs” Project @ongchinhwee

Data.gov.sg Weather Data API Scraping Scraping weather data from APIs via Python “Requests” library “Requests”: Python library for humans to send HTTP requests @ongchinhwee

Data.gov.sg Weather Data API Scraping Scraping weather data from APIs via Python “Requests” library Currently supported Data.gov.sg APIs: 1. Air Temperature (in degree Celsius) — 17 Weather Stations 2. Rainfall (in mm) — 53 Weather Stations @ongchinhwee

Data.gov.sg Weather Data API Scraping Scraping weather data from APIs via Python “Requests” library Currently supported Data.gov.sg APIs: 1. Air Temperature (in degree Celsius) 2. Rainfall (in mm) Scrap data for continuous time range + specific weather station @ongchinhwee

API Scraping Demo @ongchinhwee

Singapore’s Weather Station Positions (Source: Weather.gov.sg) 新加坡气象站位置 @ongchinhwee

Time Series Analysis of Singapore Weather Station Data Selected weather station: Changi Weather Station (ID: S24) Analysis timeframe: 2 Dec 2016 to 30 Nov 2019 (~3 years) Objective: - Extract trend and seasonality from minute-by-minute weather time series @ongchinhwee

Time Series Analysis Demo @ongchinhwee

Key Takeaways 1. Open data needs to be accessible to anyone to be useful. ○ Putting data out on the web with open data license is usually not enough - it’s not just developers using open data! @ongchinhwee

Key Takeaways 1. Open data needs to be accessible to anyone to be useful. ○ Putting data out on the web with open data license is usually not enough - it’s not just developers using open data! 2. If an open data source is not intuitive enough to use, build a tool to make the data more accessible for everyone! @ongchinhwee

Reach out to me! And check out my project on: : ongchinhwee : @ongchinhwee : hweecat https://ongchinhwee.me hweecat/api-scraping-nea-datasets @ongchinhwee