I have some folders containing text files that each have 9 numbers per row seperated by a comma. Up until now I loaded the data from a single file into a single 2d array like so:
import numpy as np
fn = "file.txt"
data = np.loadtxt(fn, delimiter = ",")
chans = data.shape[1]
vals = data.shape[0]
I simply loaded the data from a text file into a single 2d array and did some some stuff with it. What I would like to do now is load data from multiple text files into a single 2d array.
So far I tried iterating through multiple files and loading the data into a list, then turning the list into an array, but then I got an array of 2d arrays. Is there any way to achieve what I'm looking for? I only recently started working with Python so I am unaware of certain tricks.