First, the basic
The 1.python various derivations (list comprehension, the derivation dictionary, the set of derivation)
List comprehensions: datalist = [i**2 for i in range(30) if i % 3 is 0] Dictionary derivations: from numpy.random import randn datadict = {i:randn() for i in range(7)} Collection derivations: dataset = {x**2 for x in [1, 1, 2]}
2.matplotlib
import matplotlib.pyplot as plt img = plt.imread("C:\\Users\\Administrator\\Pictures\\1.jpg") plt.imshow(img) plt.show() Note: plt.imshow () function is responsible for image processing and display format; () function after the image sucked plt.imshow () processing shown plt.show
Two, numpy basis