分层抽样分层抽样查看分组
分层抽样import pandas as pd import numpy as npdf=pd.DataFrame(np.random.randn(20).reshape(10,2))df['2'] = [5,5,5,5,5,2,2,2,3,3]typicalNDict={ 5:3, 2:2, 3:1 } #函数定义 def typicalsamling(group,typicalNDict): name=group