

def new_dxgtable(columns=None, indices=None, init_from=None, mode=None, **kwargs):
    '\n    :param columns: An ordered list containing column descriptors.  See :meth:`~dxpy.bindings.dxgtable.DXGTable.make_column_desc` (required if *init_from* is not provided)\n    :type columns: list of column descriptors\n    :param indices: An ordered list containing index descriptors. See description in :func:`~dxpy.bindings.dxgtable.DXGTable._new`.\n    :type indices: list of index descriptors\n    :param init_from: GTable from which to initialize the metadata including column and index specs\n    :type init_from: :class:`~dxpy.bindings.dxgtable.DXGTable`\n    :param mode: One of "w" or "a" for write and append modes, respectively\n    :type mode: string\n    :returns: Remote table handler for the newly created table\n    :rtype: :class:`~dxpy.bindings.dxgtable.DXGTable`\n\n    Additional optional parameters not listed: all those under\n    :func:`dxpy.bindings.DXDataObject.new`.\n\n    Creates a new remote GTable with the given columns. If indices are\n    given, the GTable will be indexed by the requested indices at the\n    time that the table is closed.\n\n    Example::\n\n        col_descs = [dxpy.DXGTable.make_column_desc("a", "string"),\n                     dxpy.DXGTable.make_column_desc("b", "int32")]\n        with new_dxgtable(columns=col_descs, mode=\'w\') as dxgtable:\n            dxgtable.add_rows([["foo", 23], ["bar", 7]])\n\n        gri_cols = [dxpy.DXGTable.make_column_desc("chr", "string"),\n                    dxpy.DXGTable.make_column_desc("lo", "int32"),\n                    dxpy.DXGTable.make_column_desc("hi", "int32")]\n        gri_index = dxpy.DXGTable.genomic_range_index("chr", "lo", "hi")\n        indexed_table = new_dxgtable(columns=gri_cols, indices=[gri_index])\n\n    Note that this function is shorthand for the following::\n\n        dxgtable = DXGTable()\n        dxgtable.new(columns, **kwargs)\n\n    '
    dxgtable = DXGTable(mode=mode)
    dxgtable.new(columns=columns, indices=indices, init_from=init_from, **kwargs)
    return dxgtable

dataset/ETHPy150Open dnanexus/dx-toolkit/src/python/dxpy/bindings/dxgtable_functions.py new_dxgtable/original