Mengimpor file HDF5

Pengantar Mengimpor Data di Python

Hugo Bowne-Anderson

Data Scientist at DataCamp

File HDF5

  • Hierarchical Data Format versi 5
  • Standar untuk menyimpan data numerik skala besar
  • Dataset bisa ratusan gigabyte atau terabyte
  • HDF5 dapat diskalakan hingga exabyte
Pengantar Mengimpor Data di Python

Mengimpor file HDF5

import h5py
filename = 'H-H1_LOSC_4_V1-815411200-4096.hdf5'
data = h5py.File(filename, 'r') # 'r' is to read
print(type(data))
<class 'h5py._hl.files.File'>
Pengantar Mengimpor Data di Python

Struktur file HDF5

for key in data.keys():
    print(key)
meta
quality
strain
print(type(data['meta']))
<class 'h5py._hl.group.Group'>

Struktur file HDF5

Pengantar Mengimpor Data di Python

Struktur file HDF5

for key in data['meta'].keys():
    print(key)
Description
DescriptionURL
Detector
Duration
GPSstart
Observatory
Type
UTCstart
print(np.array(data['meta']['Description']), np.array(data['meta']['Detector']))
b'Strain data time series from LIGO' b'H1'
Pengantar Mengimpor Data di Python

Proyek HDF

  • Dimaintain aktif oleh HDF Group

Logo Proyek HDF

  • Berbasis di Champaign, Illinois
Pengantar Mengimpor Data di Python

Ayo berlatih!

Pengantar Mengimpor Data di Python

Preparing Video For Download...