python杂记
1.image
import numpy as np
from PIL import Image
image = Image.open(imgName).resize((64, 64))
imageArray = np.array(image)
2. 保存,加载
import numpy as np
# Save
dictionary = {'hello':'world'}
np.save('my_file.npy', dictionary)
# Load
read_dictionary = np.load('my_file.npy', allow_pickle=True).item()
print(read_dictionary['hello']) # displays "world"
3. range函数的数据类型不是list而是range