In [1]: import pandas as pd import numpy as np df=pd.DataFrame({'A':['foo','bar','foo','bar', 'foo','bar','foo','foo'], 'B':['one','one','two','three', 'two','two','one','three'], 'C':np.random.randn(8), 'D':np.random.randn(8)})#randn=>具有标准正态分布 df Ou…