MCPcopy Index your code
hub / github.com/PyTables/PyTables / append

Method append

tables/earray.py:218–238  ·  view source on GitHub ↗

Add a sequence of data to the end of the dataset. The sequence must have the same type as the array; otherwise a TypeError is raised. In the same way, the dimensions of the sequence must conform to the shape of the array, that is, all dimensions must match, with the

(self, sequence: npt.ArrayLike)

Source from the content-addressed store, hash-verified

216 )
217
218 def append(self, sequence: npt.ArrayLike) -> None:
219 """Add a sequence of data to the end of the dataset.
220
221 The sequence must have the same type as the array; otherwise a
222 TypeError is raised. In the same way, the dimensions of the
223 sequence must conform to the shape of the array, that is, all
224 dimensions must match, with the exception of the enlargeable
225 dimension, which can be of any length (even 0!). If the shape
226 of the sequence is invalid, a ValueError is raised.
227
228 """
229 self._g_check_open()
230 self._v_file._check_writable()
231
232 # Convert the sequence into a NumPy object
233 nparr = convert_to_np_atom2(sequence, self.atom)
234 # Check if it has a consistent shape with underlying EArray
235 self._check_shape_append(nparr)
236 # If the size of the nparr is zero, don't do anything else
237 if nparr.size > 0:
238 self._append(nparr)
239
240 def _g_copy_with_stats(
241 self,

Callers 1

create_earrayMethod · 0.95

Calls 4

_check_shape_appendMethod · 0.95
convert_to_np_atom2Function · 0.85
_g_check_openMethod · 0.80
_check_writableMethod · 0.80

Tested by

no test coverage detected