Initializing help system before first use

problem.getnamelist

Purpose
Returns the names for the rows, columns, sets, piecewise linear constraints, general constraints or objectives in a given range. The names will be returned in a list of Python strings.
Synopsis
names = problem.getnamelist(type, first, last)
Arguments
type 
xpress.names_row 
for row names;
xpress.names_column 
for column names;
xpress.names_set 
for set names;
xpress.names_pwlcons 
for piecewise linear constraint names;
xpress.names_gencons 
for general constraint names;
xpress.names_objective 
for objective names.
names 
A list containing all returned names.
first 
First row, column or set in the range. If None, it is taken as zero.
last 
Last row, column or set in the range. If None, it is taken as the penultimate element in the list defined by type.
Example
The following example retrieves and outputs the row and column names for the current problem.
cols = prob.attributes.cols
rows = prob.attributes.rows

rnames = prob.getnamelist(1, 0, rows - 1)
cnames = prob.getnamelist(2, 0, cols - 1)

for k,v in enumerate(rnames):
    print("Row {0:4d}: {1}", k, v)

for k,v in enumerate(cnames):
    print("Column {0:4d}: {1}", k, v)

© 2001-2024 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.