<jupyter_start><jupyter_text>Summary Problem 1Count the number of times a depth measurement increases from the previous measurement.<jupyter_code>def count_depth_increase(input_file):
    with open(input_file,'r') as input_text:
        numbers_str = input_text.read()
    numbers_str_list = numbers_str.split('\n')
    num_list = [int(n) for n in numbers_str_list]
    count = 0
    for i in range (1,len(num_list)):
        if num_list[i] > num_list[i-1]:
            count = count+1
    return(count)        
count_depth_increase("depth.txt")<jupyter_output><empty_output><jupyter_text>Problem 2Count the number of times the sum of 3 measurements in this sliding window increases from the previous sum.<jupyter_code>def make_num_list(input_file):
    with open(input_file,'r') as input_text:
        numbers_str = input_text.read()
    numbers_str_list = numbers_str.split('\n')
    num_list = [int(n) for n in numbers_str_list]
    return(num_list)

def make_win_list_2(input_num_list, win_width):
    window_sum_measurements = [sum(input_num_list[i:i+win_width]) for i in range (len(input_num_list)-(win_width-1))]
    return(window_sum_measurements)  

def count_win_depth_increase(input_win_list):
    length_list = len(input_win_list)
    count = 0
    for i in range (1,length_list):
        if input_win_list[i] > input_win_list[i-1]:
            count = count+1
    return(count)      
num_list = make_num_list("depth.txt")
win_list = make_win_list_2(num_list,3)
count_win_depth_increase(win_list)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0988296488946684, 'fraction_numerical': 0.00975292587776333, 'mean_word_length': 4.496428571428571, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '440340', 'license': 'MIT', 'n_tokens_mistral': 547, 'n_tokens_neox': 536, 'n_words': 112, 'path': 'day_01/summary.ipynb', 'repo_name': 'naoe-tatara/aoc_2021', 'size': '1538'}