How can I randomly read 50% of the number of files:
files = glob.glob("*.txt")
##suppose files are objects
for fi in files:
#I want to implement through the for loop
data = np.genfromtxt(fi, ...)
Edit: I want to implement through the for loop, in my other problem, the files are object .