def pd_split(df, p, random_state=None):
 p = list(p)
 index = pseudorandom(len(df), p, random_state)
 return [df.iloc[(index == i)] for i in range(len(p))]

def pd_split ( df , p , random_state = None ) : p = list ( p ) index = pseudorandom ( len ( df ) , p , random_state ) return [ df . iloc [ ( index == i ) ] for i in range ( len ( p ) ) ]
split dataframe into multiple pieces pseudorandomly .