1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Importing Data in Python

Exercise

Using h5py to import HDF5 files

The file 'LIGO_data.hdf5' is already in your working directory. In this exercise, you'll import it using the h5py library. You'll also print out its datatype to confirm you have imported it correctly. You'll then study the structure of the file in order to see precisely what HDF groups it contains.

You can find the LIGO data plus loads of documentation and tutorials here. There is also a great tutorial on Signal Processing with the data here.

Instructions

100 XP
  • Import the package h5py.
  • Assign the name of the file to the variable file.
  • Load the file as read only into the variable data.
  • Print the datatype of data.
  • Print the names of the groups in the HDF5 file 'LIGO_data.hdf5'.