def today_compare_data(js_file1, js_file2, search_region, confirmed_cmp, array):
    with open(js_file1, 'r', encoding='utf-8') as f1:
        with open(js_file2, 'r', encoding='utf-8') as f2:
            json_data_1 = json.load(f1)
            json_data_2 = json.load(f2)
            for i in range(0, (len(json_data_1) - 1)):
                region = json_data_1[i]['지역이름']
                confirmed_1 = json_data_1[i]['확진자수']
                confirmed_2 = json_data_2[i]['확진자수']
                cmp_data = (confirmed_1 - confirmed_2)
                confirmed_cmp.append({'지역이름': region, '전날비교': cmp_data})
            for i in range(0, len(confirmed_cmp)):
                if (confirmed_cmp[i]['지역이름'] == search_region):
                    list = [int(i) for i in str(confirmed_cmp[i]['전날비교'])]
                    for j in range(0, len(list)):
                        for x in range(5):
                            for y in range((22 + (4 * j)), (26 + (4 * j))):
                                array[x][y] = number_array[list[j]][x][((y - 22) - (4 * j))]
                    for x in range(5):
                        for y in range((21 + (4 * len(list))), ((21 + (4 * len(list))) + 3)):
                            array[x][y] = arrow_array[0][x][((y - 21) - (4 * len(list)))]
            return confirmed_cmp
def today_compare_data(js_file1, js_file2, search_region, confirmed_cmp, array):
    with open(js_file1, 'r', encoding='utf-8') as f1:
        with open(js_file2, 'r', encoding='utf-8') as f2:
            json_data_1 = json.load(f1)
            json_data_2 = json.load(f2)
            for i in range(0, (len(json_data_1) - 1)):
                region = json_data_1[i]['지역이름']
                confirmed_1 = json_data_1[i]['확진자수']
                confirmed_2 = json_data_2[i]['확진자수']
                cmp_data = (confirmed_1 - confirmed_2)
                confirmed_cmp.append({'지역이름': region, '전날비교': cmp_data})
            for i in range(0, len(confirmed_cmp)):
                if (confirmed_cmp[i]['지역이름'] == search_region):
                    list = [int(i) for i in str(confirmed_cmp[i]['전날비교'])]
                    for j in range(0, len(list)):
                        for x in range(5):
                            for y in range((22 + (4 * j)), (26 + (4 * j))):
                                array[x][y] = number_array[list[j]][x][((y - 22) - (4 * j))]
                    for x in range(5):
                        for y in range((21 + (4 * len(list))), ((21 + (4 * len(list))) + 3)):
                            array[x][y] = arrow_array[0][x][((y - 21) - (4 * len(list)))]
            return confirmed_cmp