Range constraint requires two values
AnsweredHello when I read my data from Excel and rewrite them to list , pandas makes them like this :
I1=[[3], [4]]
but I wanna them like this I1=[3, 4] to eliminate this error
What should I do to eliminate this error
My excel data 
my program to read this excel and write it to list is :
#Read initial Local stock from Excel
df=pd.read_excel("S1.xlsx")
b=df.drop(columns='Article',axis=1)
I1=b.values.tolist()
print(I1)
0
-
Official comment
This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
There might be an easier way, but this should work:
I1 = [s[0] for s in I1]
0
Post is closed for comments.
Comments
2 comments