I am reading various image files from a folder iteratively in a for loop. After each image is being read, the data in the image is goign through manipulations and at the end of for loop, I have a numpy array.
I am looking for a way to append the numpy array into a pandas data frame, as columns. Meaning, if I have five image files --> five numpy arrays --> five columns in the data frame.
I tried by converting it into list and then into dataframe (as follows)
for f in glob.glob(path + "/*.tif"):
#various manipulations on images.....
# A numpy array - Example numpy array output
a = np.array([1 2 3 4 5])
a_list = a.tolist()
lis.append(a_list)
df= pd.concat(lis, axis=1, ignore_index=True)
This process did not work and it is also inefficient.
Looking for suggestions on a simple way to add the numpy array that comes out of the for loop to a pandas data frame. At the end each numpy array output from the loop, gets added as a column.