pytables

How to copy a dataset object to a different hdf5 file using pytables or h5py?

孤街浪徒 提交于 2020-08-09 08:00:30
问题 I have selected specific hdf5 datasets and want to copy them to a new hdf5 file. I could find some tutorials on copying between two files, but what if you have just created a new file and you want to copy datasets to the file? I thought the way below would work, but it doesn't. Are there any simple ways to do this? >>> dic_oldDataset['old_dataset'] <HDF5 dataset "old_dataset": shape (333217,), type "|V14"> >>> new_file = h5py.File('new_file.h5', 'a') >>> new_file.create_group('new_group') >>>

How to copy a dataset object to a different hdf5 file using pytables or h5py?

僤鯓⒐⒋嵵緔 提交于 2020-08-09 07:59:51
问题 I have selected specific hdf5 datasets and want to copy them to a new hdf5 file. I could find some tutorials on copying between two files, but what if you have just created a new file and you want to copy datasets to the file? I thought the way below would work, but it doesn't. Are there any simple ways to do this? >>> dic_oldDataset['old_dataset'] <HDF5 dataset "old_dataset": shape (333217,), type "|V14"> >>> new_file = h5py.File('new_file.h5', 'a') >>> new_file.create_group('new_group') >>>

Pytables NumExpr ValueError: too many inputs when querying with a lot of conditions

两盒软妹~` 提交于 2020-05-17 03:40:06
问题 I encounter this error when querying a pytables table with where method passing a string with 50 conditions. These conditions are basically a translation of a SQL IN clause i.e. I want to get records where a particular field is equal to a certain list of values. C:\Python2764\lib\site-packages\numexpr\necompiler.pyc in evaluate(ex, local_dict, global_dict, out, order, casting, **kwargs) 744 kwargs = {'out': out, 'order': order, 'casting': casting, 745 'ex_uses_vml': ex_uses_vml} --> 746

Column missing when trying to open hdf created by pandas in h5py

白昼怎懂夜的黑 提交于 2020-05-16 22:32:09
问题 This is what my dataframe looks like. The first column is a single int. The second column is a single list of 512 ints. IndexID Ids 1899317 [0, 47715, 1757, 9, 38994, 230, 12, 241, 12228... 22861131 [0, 48156, 154, 6304, 43611, 11, 9496, 8982, 1... 2163410 [0, 26039, 41156, 227, 860, 3320, 6673, 260, 1... 15760716 [0, 40883, 4086, 11, 5, 18559, 1923, 1494, 4, ... 12244098 [0, 45651, 4128, 227, 5, 10397, 995, 731, 9, 3... I saved it to hdf and tried opening it using df.to_hdf('test.h5', key=

Column missing when trying to open hdf created by pandas in h5py

回眸只為那壹抹淺笑 提交于 2020-05-16 22:31:31
问题 This is what my dataframe looks like. The first column is a single int. The second column is a single list of 512 ints. IndexID Ids 1899317 [0, 47715, 1757, 9, 38994, 230, 12, 241, 12228... 22861131 [0, 48156, 154, 6304, 43611, 11, 9496, 8982, 1... 2163410 [0, 26039, 41156, 227, 860, 3320, 6673, 260, 1... 15760716 [0, 40883, 4086, 11, 5, 18559, 1923, 1494, 4, ... 12244098 [0, 45651, 4128, 227, 5, 10397, 995, 731, 9, 3... I saved it to hdf and tried opening it using df.to_hdf('test.h5', key=

How can I solve this 3D regular grid interpolation problem

℡╲_俬逩灬. 提交于 2020-03-05 06:01:07
问题 I am a new python user. I have a h5 file, which is a snapshot of gravitational potential at a fixed redshift. I have read the h5 file in python and now I want to write a code which will give the value of the gravitational potential for given values of (x, y, z) by using trilinear interpolation. Can anyone of you please help me to do that? For your kind consideration, the code is given below: In [1]: import numpy as np In [2]: import h5py In [3]: from scipy.interpolate import

Convert large hdf5 dataset written via pandas/pytables to vaex

怎甘沉沦 提交于 2020-01-14 06:22:19
问题 I have a very large dataset I write to hdf5 in chunks via append like so: with pd.HDFStore(self.train_store_path) as train_store: for filepath in tqdm(filepaths): with open(filepath, 'rb') as file: frame = pickle.load(file) if frame.empty: os.remove(filepath) continue try: train_store.append( key='dataset', value=frame, min_itemsize=itemsize_dict) os.remove(filepath) except KeyError as e: print(e) except ValueError as e: print(frame) print(e) except Exception as e: print(e) The data is far

Unable to reinstall PyTables for Python 2.7

我怕爱的太早我们不能终老 提交于 2020-01-12 18:48:50
问题 I am installing Python 2.7 in addition to 2.7. When installing PyTables again for 2.7, I get this error - Found numpy 1.5.1 package installed. .. ERROR:: Could not find a local HDF5 installation. You may need to explicitly state where your local HDF5 headers and library can be found by setting the HDF5_DIR environment variable or by using the --hdf5 command-line option. I am not clear on the HDF installation. I downloaded again - and copied it into a /usr/local/hdf5 directory. And tried to

Unable to reinstall PyTables for Python 2.7

人盡茶涼 提交于 2020-01-12 18:48:26
问题 I am installing Python 2.7 in addition to 2.7. When installing PyTables again for 2.7, I get this error - Found numpy 1.5.1 package installed. .. ERROR:: Could not find a local HDF5 installation. You may need to explicitly state where your local HDF5 headers and library can be found by setting the HDF5_DIR environment variable or by using the --hdf5 command-line option. I am not clear on the HDF installation. I downloaded again - and copied it into a /usr/local/hdf5 directory. And tried to