code: def chunk_pandas(frame_or_series, chunksize=None):
      
      if not isinstance(chunksize, int):
          raise ValueError('argument chunksize needs to be integer type')
  
      bins = np.arange(0, len(frame_or_series), step=chunksize)
  
      for b in bins:
  
          yield frame_or_series[b:b + chunksize]
docs: Chunk a frame into smaller, equal parts.