<jupyter_start><jupyter_text>PSNH IDR Split<jupyter_code>import pandas as pd
import numpy as np
import IDRdrop
import json
import os
print('imported modules successfully.')<jupyter_output>imported modules successfully.<jupyter_text>Show downloaded files from EPO portal<jupyter_code>readpath = "C:\\Users\\wb5888\\Downloads"

myfiles = IDRdrop.show_dir(readpath, 10)
print(myfiles)
dl = myfiles.files[[8]]
dl[8]
files = ['PSNH_80044561043_IDR.csv', 'PSNH_80044560474_IDR.csv', 'PSNH_80044560557_IDR.csv', 'PSNH_80044560631_IDR.csv']
other = ['PSNH_80044560714_IDR.csv', 'PSNH_80044560896_IDR.csv', 'PSNH_80044560979_IDR.csv']<jupyter_output><empty_output><jupyter_text>Split downloaded into separate files<jupyter_code>def psnh_split(data, filenames):
    
    master = pd.read_csv(data, header = None, names = list('abcdef'))
    subset = np.where(master.a == 'Customer Name')[0]
    subset = [a for a in subset]
    n = len(master.a)
    subset.append(n)
    m = len(subset)

    for j, index in enumerate(subset):
        if j < m-1:
            subset_df = master.iloc[subset[j]:subset[(j+1)],:]
            print(subset_df.head())
            print(filenames[j])
            subset_df.to_csv(filenames[j], header = None, index = None)
            print('wrote {}.'.format(filenames[j]))

psnh_split(dl[8], files)
for j, index in enumerate(subset):
    if j < m-1:
        subset_df = master.iloc[subset[j]:subset[(j+1)],:]
        subset_df.to_csv()
kohls
master.iloc[kohls[0]-6:kohls[1]-6,:]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14341846758349705, 'fraction_numerical': 0.06221349050425671, 'mean_word_length': 4.437722419928826, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '56501', 'license': 'MIT', 'n_tokens_mistral': 658, 'n_tokens_neox': 587, 'n_words': 104, 'path': 'IDR_Drop/PSNH_split.ipynb', 'repo_name': 'stevenhurwitt/dealersocket-speedtest', 'size': '1527'}