<commit_before>"""
This module implements a portion of the Input Format Module.  In this
case the input is the tabular data necessary for the different interpolations.
"""

import numpy as np


def read_num_col(filename):
    with open(filename, 'rb') as f:
        num_col = [f.readline()]

    num_col = np.genfromtxt(num_col, delimiter=',', dtype=str)
    num_col = num_col[1::2].astype(float)
    
    return num_col
    
def read_array1(filename, length):
    array1 = np.loadtxt(filename, delimiter=',', usecols=range(0, 2*length, 2), skiprows=1)
    return array1
    
def read_array2(filename, length):
    array2 = np.loadtxt(filename, delimiter=',', usecols=range(1, 2*length, 2), skiprows=1)
    return array2<commit_msg>Remove numpy dependency from glassbr python code<commit_after>"""
This module implements a portion of the Input Format Module.  In this
case the input is the tabular data necessary for the different interpolations.
"""


def read_num_col(filename):
    with open(filename, "r") as f:
        line = f.readline()
    z_array = line.split(",")[1::2]
    z_array = [float(i) for i in z_array]  
    return z_array
    
def read_array1(filename, length):
    with open(filename, "r") as f:
        lines = f.readlines()
    lines = lines[1:]
    x_array = [line.split(",")[0::2] for line in lines]
    for i in range(len(x_array)):
        x_array[i] = [float(j) for j in x_array[i]]
    return x_array
    
def read_array2(filename, length):
    with open(filename, "r") as f:
        lines = f.readlines()
    lines = lines[1:]
    y_array = [line.split(",")[1::2] for line in lines]
    for i in range(len(y_array)):
        y_array[i] = [float(j) for j in y_array[i]]
    return y_array
{'fraction_non_alphanumeric': 0.12747380675203726, 'fraction_numerical': 0.015133876600698487, 'mean_word_length': 3.4882506527415145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7663268', 'n_tokens_mistral': 591, 'n_tokens_neox': 582, 'n_words': 179}