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

Method create_array

tables/file.py:1122–1237  ·  view source on GitHub ↗

Create a new array. Parameters ---------- where : str or Group The parent group from which the new array will hang. It can be a path string (for example '/level1/leaf5'), or a Group instance (see :ref:`GroupClassDescr`). name : str

(
        self,
        where: Group | str,
        name: str,
        obj: np.ndarray | None = None,
        title: str = "",
        byteorder: str | None = None,
        createparents: bool = False,
        atom: Atom | None = None,
        shape: tuple[int, ...] | None = None,
        track_times: bool = True,
    )

Source from the content-addressed store, hash-verified

1120 return ptobj
1121
1122 def create_array(
1123 self,
1124 where: Group | str,
1125 name: str,
1126 obj: np.ndarray | None = None,
1127 title: str = "",
1128 byteorder: str | None = None,
1129 createparents: bool = False,
1130 atom: Atom | None = None,
1131 shape: tuple[int, ...] | None = None,
1132 track_times: bool = True,
1133 ) -> Array:
1134 """Create a new array.
1135
1136 Parameters
1137 ----------
1138 where : str or Group
1139 The parent group from which the new array will hang. It can be a
1140 path string (for example '/level1/leaf5'), or a Group instance
1141 (see :ref:`GroupClassDescr`).
1142 name : str
1143 The name of the new array
1144 obj : python object
1145 The array or scalar to be saved. Accepted types are NumPy
1146 arrays and scalars, as well as native Python sequences and
1147 scalars, provided that values are regular (i.e. they are
1148 not like ``[[1,2],2]``) and homogeneous (i.e. all the
1149 elements are of the same type).
1150
1151 Also, objects that have some of their dimensions equal to 0
1152 are not supported (use an EArray node (see
1153 :ref:`EArrayClassDescr`) if you want to store an array with
1154 one of its dimensions equal to 0).
1155
1156 .. versionchanged:: 3.0
1157 The *Object parameter has been renamed into *obj*.*
1158
1159 title : str
1160 A description for this node (it sets the TITLE HDF5 attribute on
1161 disk).
1162 byteorder : str
1163 The byteorder of the data *on disk*, specified as 'little' or
1164 'big'. If this is not specified, the byteorder is that of the
1165 given object.
1166 createparents : bool, optional
1167 Whether to create the needed groups for the parent path to exist
1168 (not done by default).
1169 atom : Atom
1170 An Atom (see :ref:`AtomClassDescr`) instance representing
1171 the *type* and *shape* of the atomic objects to be saved.
1172
1173 .. versionadded:: 3.0
1174
1175 shape : tuple of ints
1176 The shape of the stored array.
1177
1178 .. versionadded:: 3.0
1179

Callers 15

setUpFunction · 0.45
demo_6times3marksFunction · 0.45
demo_manyopsFunction · 0.45
create_fileFunction · 0.45
table-tree.pyFile · 0.45
attributes1.pyFile · 0.45
create_test_fileFunction · 0.45
array2.pyFile · 0.45
tutorial3-1.pyFile · 0.45
array3.pyFile · 0.45
inmemory.pyFile · 0.45
array4.pyFile · 0.45

Calls 4

_get_or_create_pathMethod · 0.95
flavor_ofFunction · 0.85
array_as_internalFunction · 0.85
ArrayClass · 0.85

Tested by

no test coverage detected