docstr: Sample the dataframe.
  
  Args:
      n (int, optional): Number of rows to sample. Defaults to 5.
  
  Returns:
      DataFrameType: Sampled dataframe.
code: def sample(self, n: int = 3) -> pd.DataFrame:
      """Sample the dataframe.
  
      Args:
          n (int, optional): Number of rows to sample. Defaults to 5.
  
      Returns:
          DataFrameType: Sampled dataframe.
      """
      sampled_df = pd.DataFrame()
      if len(self.df) <= n:
          sampled_df = self.df.sample(frac=1)
      else:
          for col in self.df.columns:
              col_sample = self._sample_column(col, n)
              sampled_df[col] = col_sample
  
      # anonymize the sampled dataframe head
      sampled_df = Anonymizer.anonymize_dataframe_head(sampled_df)
  
      return sampled_df
  
file_path: pandas-ai/pandasai/helpers/data_sampler.py
imports: import random
  import pandas
  import numpy
  from .df_info import df_type, DataFrameType
  from .anonymizer import Anonymizer
label_desc: Use image node_id 2 for calling the DataSampler obj's underlying member method code with example usage: obj.sample(n) and returns: sampled_df