Scripting Guide > Python > Python Syntax Reference > Data Table Functions
Publication date: 07/24/2024

Data Table Functions

dt = jmp.DataTable(name='string', rows=n)

Description

Creates a new data table with the name 'string' and n number of rows. The arguments are optional. If they are specified, they must be in the order: name, row. If the arguments are not specified in that order, the keywords name= and rows= must be used.

dt.add_rows(rows=n, after=m)

Description

Inserts n number of rows after row m. The after argument is optional.

dt.name = 'new name'

Description

Sets the data table’s name as the string 'new name'.

dt.new_column(name='string', dtype='string', mtype='string', dlen='string', where=n)

Description

Creates a new column object in the data table. All arguments are optional. Passing no arguments to dt.new_column() creates a default new column after the last column of the current data table with a numeric data type and a Continuous modeling type.

Arguments

name

Specifies the name of the new column.

dtype

Specifies the data type of the new column using the jmp.DataType enumeration values.

mtype

Specifies the modeling type of the new column using the jmp.ModelingType enumeration values.

dlen

Specifies the data length of columns with the Numeric data type.

where

Specifies the placement of the new column.

dt.save(path='file_path')

Description

Saves the data table to the specified file path or the current directory of the script if no path is specified.

dt.close(save=True|False)

Description

Closes the data table. The save argument is optional, and data tables are saved before closing if the argument is omitted. Setting the save argument to False closes the data table without saving.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).