Model.tableaddcolumn#

Model.tableaddcolumn(name, data_type, column_label, string_array)#

Adds a column of data to the right of a table.

Parameters:
  • name (hwString) – The name of the table to update.

  • data_type (hwString) – The data type of the column. See Model.tablecreate() for valid values.

  • column_label (hwString) – The label of the column.

  • string_array (hwStringList) – The string array that contains the column data to add. The length of the list should be equal to the number of rows in the table.

Example#

Add a column of type integer and label INTEGER to “ table1 “ which has 7 rows#
import hm
import hm.entities as ent

model = hm.Model()

model.tableaddcolumn(
    name="table1",
    data_type="int",
    column_label="INTEGER",
    string_array=["1", "2", "3", "4", "5","6", "7"],
)