H5py ile oluşturduğum HDF5 formatındaki dosyaları okumaya çalışırken panda hatası alıyorum. Ben sadece yanlış bir şey yapıyorum merak ediyorum? Nesne mevcut değilse bir stoklayıcı oluşturamaz ne de bir değer ben '/ sıfır' (Ben yapardım olarak anahtar grubunu belirtmek çalıştı Pandalar, h5py ile oluşturulmuş hdf5 dosyasını okuyamaz
geçirilir: TypeError:import h5py
import numpy as np
import pandas as pd
h5_file = h5py.File('test.h5', 'w')
h5_file.create_dataset('zeros', data=np.zeros(shape=(3, 5)), dtype='f')
h5_file.close()
pd_file = pd.read_hdf('test.h5', 'zeros')
hata veriyor Dosya okunurken h5py ile) şanssız. Bunu okumak için pandas.HDFStore kullanırsanız
, geri boş mağaza olsun:
h5_back = h5py.File('test.h5', 'r')
h5_back['/zeros']
<HDF5 dataset "zeros": shape (3, 5), type "<f4">
bu kullanma:
store = pd.HDFStore('test.h5')
>>> store
<class 'pandas.io.pytables.HDFStore'>
File path: test.h5
Empty
Ben h5py geri yeni oluşturulan dosyayı okurken hiçbir sorunları var sürümleri: önceden
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
pd.__version__
'0.16.2'
h5py.__version__
'2.5.0'
Çok teşekkürler, Masha
Ayrıca bkz. Https://github.com/pandas-dev/pandas/issues/9539 –