<jupyter_start><jupyter_text>Processing h5 files with LibROSA data<jupyter_code>import h5py
import numpy as np
import os
import pandas as pd
%matplotlib inline
beethoven_5_files = [
        "295/01.h5",
        "340/01.h5",
        "349/01.h5",
        "1219/01.h5",
        "1222/05.h5",
        "1398/04.h5",
        "1449/01.h5",
        "1709/09.h5",
        "1710/03.h5",
        "1711/02.h5",
        "1758/01.h5",
        "1911/01.h5"
]
def read_h5(filename, end):
    fp     = h5py.File("data/%s" % filename, "r")
    onsets = fp.get('librosa.onset.onset_detect')
    series = pd.Series(onsets[:end], name=filename)
    fp.close()
    return series

def read_files(files, end):
    df = pd.DataFrame()
    for filename in files:
        df = df.append(read_h5(filename, end))
    return df


df = read_files(beethoven_5_files, 370).T

df.plot(legend=False)
df.diff().fillna(0).plot(legend=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15434083601286175, 'fraction_numerical': 0.09860664523043944, 'mean_word_length': 2.62015503875969, 'pattern_counts': {'":': 0, '<': 5, '<?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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '626972', 'license': 'MIT', 'n_tokens_mistral': 425, 'n_tokens_neox': 377, 'n_words': 66, 'path': 'Beethoven_5.ipynb', 'repo_name': 'ChristopherThorpe/Performio', 'size': '933'}