def random_sample(self, num_samples, df=None, replace=False, weights=None, random_state=100, axis='row'):
    '''
    Return random sample of matrix.
    '''

    if df is None:
      df = self.dat_to_df()

    if axis == 'row':
      axis = 0
    if axis == 'col':
      axis = 1

    df = self.export_df()
    df = df.sample(n=num_samples, replace=replace, weights=weights, random_state=random_state,  axis=axis)

    self.load_df(df)
def random_sample ( self , num_samples , df = None , replace = False , weights = None , random_state = 100 , axis = 'row' ) : if df is None : df = self . dat_to_df ( ) if axis == 'row' : axis = 0 if axis == 'col' : axis = 1 df = self . export_df ( ) df = df . sample ( n = num_samples , replace = replace , weights = weights , random_state = random_state , axis = axis ) self . load_df ( df )
Return random sample of matrix.