Created
May 14, 2021 21:48
-
-
Save andreagrioni/404f7ea80a524e563f778526a00e9635 to your computer and use it in GitHub Desktop.
read h5 file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import h5py | |
import pandas as pd | |
# set path to h5 file | |
filepath = "h5_path" | |
# read HDF5 file | |
f = h5py.File(filepath, 'r') | |
# get each dataset and convert to pandas DataFrame | |
dset_x_train = pd.DataFrame(f['x_train']) | |
dset_y_train = pd.DataFrame(f['y_train']) | |
dset_x_test = pd.DataFrame(f['x_test']) | |
dset_y_test = pd.DataFrame(f['y_test']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment