''' This is a fractaL code developed to sonify data. Partially based on Sonify library. @author: smjacques ''' import json import matplotlib.pyplot as plt import pandas as pd import fractaL.core as fractal DirIn = 'sample_data/' FileNameIn = '1880-2019.json' with open(DirIn + FileNameIn) as data_file: climate_json = json.load(data_file) normalized_climate_data = fractal.normalize_climate_data(climate_json) plt.scatter(*zip(*normalized_climate_data)) #print(normalized_climate_data) ''' Convert Array to pandas ''' #define labels date and temperature labels = ['date', 'temperature'] climatefile = pd.DataFrame.from_records(normalized_climate_data, columns=labels) fractal.export_midi(normalized_climate_data, bpm=15, track_type='single')