Forum Discussion

FICO's avatar
FICO
Community Manager
4 years ago

?1030Error: Duplicate column names

I was adding some variables to the problem but is showed error telling there are duplicate columns in variable. I have created a small code to reproduce the error which is as follows.

import xpress as xp
prob = xp.problem()
 
key1 = ''
for i in range(150):
    key1 += '1'
key1 += '2'
 
key2 = ''
for i in range(150):
    key2 += '1'
key2 += '3'
 
indices = [key1,key2]
var1 = xp.vars(indices,vartype=xp.binary)
prob.addVariable(var1)

In my opinion, the column names are checked only to a number of characters. I wanted to know

  1. What is the limit of this number?
  2. If this number can be changed?

Thanks!

1 Reply

  • FICO's avatar
    FICO
    Community Manager

    The hard-coded limit for names in the Xpress Python API currently is 150 characters. There is no way to change that at the moment. Names will just silently be truncated.