Skip to content

Instantly share code, notes, and snippets.

@bh1995
Last active July 25, 2021 09:01
Show Gist options
  • Save bh1995/3ab0506f0e4f1f6633e073d784b54bfe to your computer and use it in GitHub Desktop.
Save bh1995/3ab0506f0e4f1f6633e073d784b54bfe to your computer and use it in GitHub Desktop.
import h5py
# load af data
path = 'af_save_path' # for ex. '/content/drive/MyDrive/ecg_data_full/af_full.h5'
h5f = h5py.File(path,'r')
af_array = h5f['af_tot'][:]
h5f.close()
# load normal data
path = 'normal_save_path' # for ex. '/content/drive/MyDrive/ecg_data_full/normal_full.h5'
h5f = h5py.File(path,'r')
normal_array = h5f['normal_tot'][:]
h5f.close()
# can also load it to pd.DataFrame and drop any NaN values
# df_af = pd.DataFrame(data=af_array)
# df_af.dropna(inplace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment