This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://stackoverflow.com/questions/22712292/how-to-use-numpy-savez-in-a-loop-for-save-more-than-one-array/22716159#22716159 | |
import numpy as np | |
import tempfile | |
class my_savez(object): | |
def __init__(self, file, compression=None, compresslevel=None): | |
# Import is postponed to here since zipfile depends on gzip, an optional | |
# component of the so-called standard library. | |
import zipfile |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import h5py | |
import argparse | |
def copy_dataset(source_file, destination_file, source_dataset, destination_dataset, overwrite): | |
with h5py.File(source_file, 'r') as source: | |
with h5py.File(destination_file, 'a') as destination: | |
if source_dataset not in source: | |
print(f"Dataset '{source_dataset}' does not exist in the source file.") | |
return | |
OlderNewer