I have problems with merging lists into a list
The followings are what I have tried
import os,glob
from PIL import Image
from skimage import io
import numpy as np
from statistics import stdev
path = "/Users/Xin/Desktop/SVM-Image-Classification-master/test"
# Delete images with the low pixel value
for filename in os.listdir(path):
images = Image.open(os.path.join(path,filename))
value = [round(np.mean(images).tolist(),2)]
print(value)
print(type(value))
#if np.mean(images) < 20:
#os.remove(os.path.join(path, filename))
#print(len(os.listdir(path)))
The output as follows
[12.69]
<class 'list'>
[14.46]
<class 'list'>
[12.25]
<class 'list'>
[9.51]
<class 'list'>
[18.7]
<class 'list'>
[10.0]
<class 'list'>
[18.13]
<class 'list'>
[12.63]
<class 'list'>
What I need is merging the above lists into a list so that I can do sum() function to get a total value
Can anyone give me a help? Thanks