This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import multiprocessing | |
from time import sleep | |
import requests | |
download_path = "./data5" | |
start_year = 2013 | |
end_year = 2023 # partial data will occur if the year has not yet ends |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
#https://en.wikipedia.org/wiki/Blend_modes#Soft_Light | |
def soft_light_blend(im1, im2): | |
nrm_im1 = im1/255. | |
nrm_im2 = im2/255. | |
res = np.zeros_like(nrm_im1) | |
xif = nrm_im2 < .5 | |
xel = nrm_im2 >= .5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def taxnum_checker(t): | |
if len(t) != 10: | |
return False | |
total = 0 | |
for x in xrange(0, 9): | |
tmp1 = (int(t[x]) + (9 - x)) % 10 | |
tmp2 = (tmp1 * (2 ** (9 - x))) % 9 | |
if tmp1 != 0 and tmp2 == 0: | |
tmp2 = 9 |