After searching a lot I couldn't find a simple way to extract data from .h5 and pass it to a data.Frame by Numpy or Pandas in order to save in .txt or .csv файл.
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")
< /code>
Keys:
< /code>
When I print data I see following results:
print(data)
< /code>
['axis0',
'axis1',
'block0_items',
'block0_values',
'block1_items',
'block1_values']
< /code>
I would appreciate the if someone [b]explain[/b] me what are they and how I can extract [b]data completely[/b] and save it in .csv file. It seems there hasn't been a routine way to do that and it's kind of challenging yet! Until now I just could see part of data via:
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)
< /code>
My expectation is to extract [b]time_stamps[/b] and [b]measurements[/b] in .h5
After searching a lot I couldn't find a simple way to extract data from .h5 and pass it to a data.Frame by Numpy or Pandas in order to save in .txt or .csv файл.
[code]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") < /code>
I would appreciate the if someone [b]explain[/b] me what are they and how I can extract [b]data completely[/b] and save it in .csv file. It seems there hasn't been a routine way to do that and it's kind of challenging yet! Until now I just could see part of data via:
После многого поиска я не смог найти простой способ извлечения данных из .h5 и передать их в data.frame by numpy или pandas , чтобы сохранить в .txt или .csv file.
import h5py
import numpy as np
import pandas as pd
После многого поиска я не смог найти простой способ извлечения данных из .h5 и передать их в data.frame by numpy или pandas , чтобы сохранить в .txt или .csv file.
import h5py
import numpy as np
import pandas as pd
У меня есть txt-файл «Основной список» со 100 студентами и их информацией, который содержит заголовок «Идентификатор студента, Имя студента, Курс, Оценка», а затем под каждым заголовком есть данные студента, такие как «91, Дональд Шульц». ,COMPSCI...
После долгих поисков я не смог найти простой способ извлечь данные из .h5 и передать их в data.Frame с помощью Numpy или Pandas в чтобы сохранить в файле .txt или .csv.
import h5py
import numpy as np
import pandas as pd
У меня есть программа (ниже), которая принимает текстовые файлы и помещает их в таблицу Excel. Моя цель — извлечь данные из текстового файла, но только текст после двоеточия.
Пример txt-файла (без пробела между строками «name:» и «phone:» в txt):...