Matrix Saved is Different from Numpy Matrix Input

Hello,

I’m trying to archive data from an instrument (SMPS) that we have in our lab. The instrument outputs multiple size distributions along with some corresponding parameters and setup information. The parameters and setup information were easy to archive, however the size distributions are giving me a hard time. I’m simply taking the size bin for each size, making it the column header and then trying to save the size distribution. Below is my code for doing this process.

import h5py
import datetime
import numpy as np
import pandas as pd

ROOT = “G:/Shared drives/Pi Chamber/04 - Experiments & Data/2021-08-19; Cloudy Saturation Ratio/data/”
DF = ROOT + “SMPS/20210820_Cloudy_Saturation_ratio_20C_16K_NaCl_130nm_Inj200k_atomizer.txt”
FILE = ROOT + “202108CloudySaturationRatio.h5”
DATASET1 = “20210820_Cloudy_Saturation_ratio_20C_16K_NaCl_130nm_Inj200k_SMPS_data”
DATASET2 = “20210820_Cloudy_Saturation_ratio_20C_16K_NaCl_130nm_Inj200k_SMPS_parameters”
DATASET3 = “20210820_Cloudy_Saturation_ratio_20C_16K_NaCl_130nm_Inj200k_SMPS_setup”

def run():

f = h5py.File(FILE, 'a');
group = f["SizeMeasurements/SMPS"]
data_setup = np.genfromtxt(DF,delimiter=',',skip_header=0,skip_footer=133, dtype='str');     
data_datetime = np.genfromtxt(DF, delimiter=',',skip_header=18,skip_footer=130,encoding='latin', dtype='str');    
data_size = np.genfromtxt(DF, delimiter=',',skip_header=21,skip_footer=26, dtype=np.float64);   
data_param1 = np.genfromtxt(DF, delimiter=',',skip_header=124,skip_footer=12);
data_param2 = np.genfromtxt(DF, delimiter=',',skip_header=140,skip_footer=2);
data_paramc = pd.read_csv(DF, skiprows=148,skipfooter=1,engine='python',encoding='latin1');


# SIZE DATA
list_text = np.char.mod('%f', data_size[:,0])
data_sizeNH = data_size[:,1:]
data_sizeT = np.transpose(data_sizeNH)
print(data_sizeT)
#np.savetxt("G:/Shared drives/Pi Chamber/04 - Experiments & Data/2021-08-19; Cloudy Saturation Ratio/data/foo.csv", data_sizeT, delimiter=",")
f1 = []
for i in range(data_sizeT.shape[1]):
    f1.append('float')
dtype1 = np.dtype({'names':list_text,'formats':f1})
dset1 = group.create_dataset(DATASET1, (data_sizeT.shape[0],data_sizeT.shape[1]), dtype=dtype1)
dset1[...] = data_sizeT; 

if name == “main”:
run()