Initializing help system before first use

problem.getnamelist

problem.getnamelist


Purpose
Returns the names for the rows, columns or sets in a given range. The names will be returned in a list of Python strings.
Synopsis
names = problem.getnamelist(type, first, last);
Arguments
type 
if row names are required;
if column names are required.
if set names are required.
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, rows - 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-2020 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.