数据介绍 先随机生成一组数据: import pandas as pd import numpy as np state = ['Ohio', 'Ohio', 'Ohio', 'Nevada', 'Nevada'] year = [2000, 2001, 2002, 2003, 2004] pop = [1.3, 1.4, 1.6, 4.5, 2.7] frame = pd.DataFrame({'state': state, 'year': year, 'pop': pop}) print(f…