How to use the tiledb.SparseArray.create function in tiledb

To help you get started, we’ve selected a few tiledb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TileDB-Inc / TileDB-Py / examples / writing_sparse_multiple.py View on Github external
def create_array():
    # The array will be 4x4 with dimensions "rows" and "cols", with domain [1,4].
    dom = tiledb.Domain(tiledb.Dim(name="rows", domain=(1, 4), tile=4, dtype=np.int32),
                        tiledb.Dim(name="cols", domain=(1, 4), tile=4, dtype=np.int32))

    # The array will be sparse with a single attribute "a" so each (i,j) cell can store an integer.
    schema = tiledb.ArraySchema(domain=dom, sparse=True,
                                attrs=[tiledb.Attr(name="a", dtype=np.int32)])

    # Create the (empty) array on disk.
    tiledb.SparseArray.create(array_name, schema)
github TileDB-Inc / TileDB-Py / examples / quickstart_sparse.py View on Github external
def create_array():
    # The array will be 4x4 with dimensions "rows" and "cols", with domain [1,4].
    dom = tiledb.Domain(tiledb.Dim(name="rows", domain=(1, 4), tile=4, dtype=np.int32),
                        tiledb.Dim(name="cols", domain=(1, 4), tile=4, dtype=np.int32))

    # The array will be sparse with a single attribute "a" so each (i,j) cell can store an integer.
    schema = tiledb.ArraySchema(domain=dom, sparse=True,
                                attrs=[tiledb.Attr(name="a", dtype=np.int32)])

    # Create the (empty) array on disk.
    tiledb.SparseArray.create(array_name, schema)
github TileDB-Inc / TileDB-Py / examples / object.py View on Github external
def create_array(array_name, sparse):
    if tiledb.object_type(array_name) == "array":
        return

    dom = tiledb.Domain(tiledb.Dim(name="rows", domain=(1, 4), tile=4, dtype=np.int32),
                        tiledb.Dim(name="cols", domain=(1, 4), tile=4, dtype=np.int32))
    schema = tiledb.ArraySchema(domain=dom, sparse=sparse,
                                attrs=[tiledb.Attr(name="a", dtype=np.int32)])
    if sparse:
        tiledb.SparseArray.create(array_name, schema)
    else:
        tiledb.DenseArray.create(array_name, schema)
github TileDB-Inc / TileDB-Py / examples / reading_sparse_layouts.py View on Github external
def create_array():
    # The array will be 4x4 with dimensions "rows" and "cols", with domain [1,4].
    dom = tiledb.Domain(tiledb.Dim(name="rows", domain=(1, 4), tile=2, dtype=np.int32),
                        tiledb.Dim(name="cols", domain=(1, 4), tile=2, dtype=np.int32))

    # The array will be sparse with a single attribute "a" so each (i,j) cell can store an integer.
    schema = tiledb.ArraySchema(domain=dom, sparse=True,
                                attrs=[tiledb.Attr(name="a", dtype=np.int32)])

    # Create the (empty) array on disk.
    tiledb.SparseArray.create(array_name, schema)