Skip to content

Instantly share code, notes, and snippets.

Avatar

Kenneth Wong KHwong12

View GitHub Profile
@KHwong12
KHwong12 / nakau.py
Last active Mar 7, 2019
Nakau stores data scraping - 1
View nakau.py
import requests
import csv
from bs4 import BeautifulSoup
from requests.exceptions import HTTPError
def get_data_nakau(storeid):
"""
Get the data of the store with given storeid
View nakau_part1.py
def main():
"""
Get the details of the shop by brute-force searching the id of the shop
"""
# Approximate minimum and maximum storeid are searched manually
storeid_min = 2050
storeid_max = 2600
outFile = 'nakau_rawdata.csv'
View MainChain.py
# The hexagon bin feature class and the related fields
table = 'hex_bins_MYS'
fields = ["Matsuya","Yoshinoya","Sukiya","Max_No","MainChain"]
with arcpy.da.UpdateCursor(table, fields) as cursor:
for row in cursor:
Mainchain = ""
for column_no in range(3):
View block1.ql
[out:json][timeout:25];
// fetch area “HK” to search in
{{geocodeArea:HK}}->.searchArea;
// gather results
(
// query part for: “route=ferry”
way["route"="ferry"](area.searchArea);
relation["route"="ferry"](area.searchArea);
);
// print results
View daylengthplot_gist.rmd
---
title: "Day length plot"
author: "Kenneth Wong"
date: "6/21/2021"
output:
md_document:
variant: markdown_github
---
```{r setup, include=FALSE}