<commit_before>import numpy as np
cimport numpy as np

def aggregate(np.ndarray[np.int_t,ndim=1] in_array, int num_to_agg):
    '''
    Calculate a new array which contains the sums of every
    num_to_agg elements of the original array.

    Example:

    aggregate([1,2,3,4], 2) #=> [3,7]

    :param in_array: A numpy array
    :param num_to_agg: The number of elements to aggregate into one
    :return: A numpy array
    '''
    cdef int length = len(in_array)
    cdef np.ndarray[np.int_t,ndim=1] out_array = np.zeros(length / num_to_agg, dtype=np.int)
    cdef int i = 0
    cdef int j = 0

    while i < length:
        out_array[i / num_to_agg] = 0;
        j = 0
        while j < num_to_agg:
            out_array[i / num_to_agg] += in_array[i+j]
            j += 1
        i += num_to_agg

    return out_array<commit_msg>Don't use int as inputs to aggregate<commit_after>import numpy as np
cimport numpy as np

def aggregate(np.ndarray[np.float,ndim=1] in_array, int num_to_agg):
    '''
    Calculate a new array which contains the sums of every
    num_to_agg elements of the original array.

    Example:

    aggregate([1,2,3,4], 2) #=> [3,7]

    :param in_array: A numpy array
    :param num_to_agg: The number of elements to aggregate into one
    :return: A numpy array
    '''
    cdef int length = len(in_array)
    cdef np.ndarray[np.float,ndim=1] out_array = np.zeros(length / num_to_agg, dtype=np.int)
    cdef int i = 0
    cdef int j = 0

    while i < length:
        out_array[i / num_to_agg] = 0;
        j = 0
        while j < num_to_agg:
            out_array[i / num_to_agg] += in_array[i+j]
            j += 1
        i += num_to_agg

    return out_array
{'fraction_non_alphanumeric': 0.09757539917208752, 'fraction_numerical': 0.01655824955647546, 'mean_word_length': 2.5031055900621118, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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}}
{'dir': 'git-commits-cleaned', 'id': '6295353', 'n_tokens_mistral': 627, 'n_tokens_neox': 601, 'n_words': 185}