Sometimes you have vectors or matrices stored in files, and you need to read them and concatenate them. One way of doing this is reading them into a list and then using Numpy’s hstack or vstack to create the vector or matrix. Like this for concatenating rows
result = np.hstack([np.genfromtxt(fName,delimiter=";") for fName in fList])
where the read matrix or vector all are of size MxNf, that is the rows, M, are the same across all read matrices while Nf can vary. The same goes for vertical stacking but then the sizes are reversed, that is, NfxM, and we have,
result = np.vstack([np.genfromtxt(fName,delimiter=";") for fName in fList])
ImageMagick comes with a tool to perform batch image transforms, it is called mogrify. To perform a resize of a set of images keeping the aspect ratio and padding with a white background we can use the following command,
mogrify -resize 100x100 -background white -gravity center -extent 100x100 -path ./resize_directory *.png
This command resizes all png images in the directory to a 100x100 and pads with white to keep the aspect ratio.
Due to python 2 and 3 it usual to have different version of installs working. A smooth method for installing packages using pip for different versions is to call pip via the python version. Like this (for Ubuntu python version 3.5),