MCPcopy Create free account
hub / github.com/apache/arrow / num_chunks

Method num_chunks

python/pyarrow/interchange/dataframe.py:115–127  ·  view source on GitHub ↗

Return the number of chunks the DataFrame consists of.

(self)

Source from the content-addressed store, hash-verified

113 return self._df.num_rows
114
115 def num_chunks(self) -> int:
116 """
117 Return the number of chunks the DataFrame consists of.
118 """
119 if isinstance(self._df, pa.RecordBatch):
120 return 1
121 else:
122 # pyarrow.Table can have columns with different number
123 # of chunks so we take the number of chunks that
124 # .to_batches() returns as it takes the min chunk size
125 # of all the columns (to_batches is a zero copy method)
126 batches = self._df.to_batches()
127 return len(batches)
128
129 def column_names(self) -> Iterable[str]:
130 """

Callers

nothing calls this directly

Calls 2

lenFunction · 0.85
to_batchesMethod · 0.80

Tested by

no test coverage detected