Код: Выделить всё
import h5py
import numpy as np
import pandas as pd
filename = 'D:\data.h5'
f = h5py.File(filename, 'r')
# List all groups
print("Keys: %s" % f.keys())
a_group_key = list(f.keys())[0]
# Get the data
data = list(f[a_group_key])
pd.DataFrame(data).to_csv("hi.csv")
Код: Выделить всё
Keys:
Код: Выделить всё
print(data)
Код: Выделить всё
['axis0',
'axis1',
'block0_items',
'block0_values',
'block1_items',
'block1_values']
Код: Выделить всё
import numpy as np
dfm = np.fromfile('D:\data.h5', dtype=float)
print (dfm.shape)
print(dfm[5:])
dfm=pd.to_csv('train.csv')
#dfm.to_csv('hi.csv', sep=',', header=None, index=None)
Подробнее здесь: https://stackoverflow.com/questions/562 ... v-properly