class_docstr: A data frame class, with only the methods required by the interchange
  protocol defined.
  Instances of this (private) class are returned from
  ``pd.DataFrame.__dataframe__`` as objects with the methods and
  attributes defined on this class.
class_docstr_tok: ["A","data","frame","class",",","with","only","the","methods","required","by","the","interchange","protocol","defined",".","Instances","of","this","(","private",")","class","are","returned","from","``","pd.DataFrame.__dataframe__","``","as","objects","with","the","methods","and","attributes","defined","on","this","class","."]
docstr: Return an iterator yielding the chunks.
docstr_tok: ["Return","an","iterator","yielding","the","chunks","."]
code: def get_chunks(
      self, n_chunks: int | None = None
  ) -> Iterable[PandasDataFrameXchg]:
      """
      Return an iterator yielding the chunks.
      """
      if n_chunks and n_chunks > 1:
          size = len(self._df)
          step = size // n_chunks
          if size % n_chunks != 0:
              step += 1
          for start in range(0, step * n_chunks, step):
              yield PandasDataFrameXchg(
                  self._df.iloc[start : start + step, :],
                  allow_copy=self._allow_copy,
              )
      else:
          yield self
  
file_path: pandas/pandas/core/interchange/dataframe.py
imports: from __future__ import annotations
  from collections import abc
  from typing import TYPE_CHECKING
  from pandas.core.interchange.column import PandasColumn
  from pandas.core.interchange.dataframe_protocol import DataFrame
label_desc: Use image node_id 13 for calling the PandasDataFrameXchg obj's underlying member method code with example usage: obj.get_chunks(n_chunks) without return types