Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

appending hdf5 files

with h5py.File('.PreprocessedData.h5', 'a') as hf:
    hf["X_train"].resize((hf["X_train"].shape[0] + X_train_data.shape[0]), axis = 0)
    hf["X_train"][-X_train_data.shape[0]:] = X_train_data

    hf["X_test"].resize((hf["X_test"].shape[0] + X_test_data.shape[0]), axis = 0)
    hf["X_test"][-X_test_data.shape[0]:] = X_test_data

    hf["Y_train"].resize((hf["Y_train"].shape[0] + Y_train_data.shape[0]), axis = 0)
    hf["Y_train"][-Y_train_data.shape[0]:] = Y_train_data

    hf["Y_test"].resize((hf["Y_test"].shape[0] + Y_test_data.shape[0]), axis = 0)
    hf["Y_test"][-Y_test_data.shape[0]:] = Y_test_data
Comment

PREVIOUS NEXT
Code Example
Python :: python webscrapping downloading all the videos in a playlist 
Python :: list comprehensions with dates 
Python :: what should I do when the keras image datagenerato is nit working 
Python :: converting 4hr 20min to minutes 
Python :: matplotlib convert color string to int 
Python :: ipywidgets unobserve functools partial 
Python :: pyhton how to chnge colour of graphs 
Python :: python consecutive numbers difference between 
Python :: numpy bitwise_or multiple images 
Python :: what does eval function do in python stack overflow 
Python :: c++ to python online converter 
Python :: qq plot using seaborn with regression line 
Python :: fibonacci sequence script python 
Python :: download textdocuments with python 
Python :: how to store svgs in django image field with SVGAndImageFormField 
Python :: filter outside queryset in list django 
Python :: how to make a password square multicolor square spiral python 
Python :: test register user mismatched passwords 
Python :: what is te meaning of nested in python 
Python :: mechanize python XE #29 
Python :: how to visualize pytorch model filters 
Python :: get_multiple_items_from_list 
Python :: get first element of each group 
Python :: asdict that ignore sentinel 
Python :: cornell hotel sustainability benchmarking index 
Python :: create view django not saving image 
Python :: looping emails using a database with python code 
Python :: Handling errors while using os.makedirs() method 
Python :: sorted string dict approach 
Python :: Python slides 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =