Hello!
I'm using pulp for linear optimization but when I run my code I get the
following output:
Central Optimization:
MAXIMIZE
0*__dummy + 0
SUBJECT TO
_C1: 2 T0 >= 0
_C2: 2 T0 <= 0
_C3: 0.0686928673545 Frigorifico0 >= 0
_C4: 0.0686928673545 Frigorifico0 <= 0
_C5: 2 Termo0 >= 0
_C6: 2 Ter
Hello! I have several numpy arrays in my script and i want to add them. For
example:
a=[1,2,3,4,5]
b=[1,1,1,1,1]
c=[1,0,1,0,1]
for i in range(5):
d[i]=a[i]+b[i]+c[i]
print d
[3,3,5,5,7]
I did it like that but I get an error: "TypeError: unsupported operand type(s)
for +: 'float' and 'num
Hello!
I have this script that scans a csv file and if the value in the first column
== 200 it saves that row into an array.
The problem is, I need to save that row and the next 10 rows in that same
array. What can I add to the script so it does that? I tried to do for row in
len(10): but I ge
The condition I want to meet is in the first column, so is there a way to read
only the first column and if the condition is true, print the rest?
--
http://mail.python.org/mailman/listinfo/python-list
Thank you, but can you explain it a little better? I am just starting in python
and I don't think I understood how to apply your awnser
--
http://mail.python.org/mailman/listinfo/python-list
Hello!
I need to read a CSV file that has "n" rows and "m" columns and if a certain
condition is met, for exameple n==200, it prints all the columns in that row.
How can I do this? I tried to save all the data in a multi-dimensional array
but I get this error:
"ValueError: array is too big."
Hello!
I need your help!
I have an array and I need pick some data from that array and put it in a list,
for example:
array= [a,b,c,1,2,3]
list=array[0]+ array[3]+ array[4]
list: [a,1,2]
When I do it like this: list=array[0]+ array[3]+ array[4] I get an error:
"TypeError: unsupported operan
It's still not working. I still have one column with all the data inside, like
this:
2999;T3;3;1;1;Off;ON;OFF;ON;ON;ON;ON;Night;;
How can I split this data in a way that if I want to print "T3" I would just do
"print array[0][1]"?
--
http://mail.python.org/mailman/listinfo/python-list
That only puts the data in one column, I wanted to separate it.
For example:
data in csv file:
1 2 3 4 5
7 8 9 10 11
a b c d e
I wanted an array where I could pick an element in each position. In the case
above if I did print array[0][3] it would pick 4
--
http://mail.python.org/mailman/lis
Hi, thanks for yor answer! ;)
Anyone has more suggestions?
--
http://mail.python.org/mailman/listinfo/python-list
Hello!
I have a CSV file with 20 rows and 12 columns and I need to store it as a
matrix. I already created an array with zeros, but I don't know how to fill it
with the data from the csv file. I have this script:
import numpy
from numpy import array
from array import *
import csv
input = open(
Nice! Thank you!
And if I need something like this?
[0 0 0 0 0.17 0.17 0.17 0.17 0 0 0 0.17 0.17 0.17 0 0 0 0 0 0 0]
How can I do this?
--
http://mail.python.org/mailman/listinfo/python-list
So I have this script:
"
from numpy import array
vt=[0]*20
vt = array(vt, dtype=dict)
for t in range(20):
if t == 4:
vt[t]=1
else:
vt[t]=0
"
And have this output:
[0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
What I need is when t == 4 I need to put 1 in that position and
Hello!!!
I have this lists a=[1,3,5,6,10], b=[a,t,q,r,s] and I need to export it to a
txt file and I can't use csv.
And I want the next format:
a 1 3 5 6 10
b a t q r s
I already have this code:
"f = open("test.txt", 'w')
f.write("a")
f.write("\n")
f.write("b")
f.write("\n")
for i in xr
t= [3,5,6,7,10,14,17,21]
Basically I want to print Test 1 when i is equal to an element of the list "t"
and print Test 2 when i is not equal:
while i<=25:
if i==t[]:
print "Test1"
else:
print "Test2"
What is missing here for this script work?
Thank you all
--
http:
So, I have this script that puts in a list every minute in 24 hours
hour=[]
i=0
t=-(1.0/60.0)
while i<24*60:
i = i+1
t = t+(1.0/60.0)
hour.append([t])
When it is doing the cicle it can have all the decimal numbers, but I need to
print the result with only 4 decimal numbers
How can I
But I still get the error and I use Excel 2010.
I'm trying to export data in a list to Excel
--
http://mail.python.org/mailman/listinfo/python-list
Is there some way to go around this limit? I need to import data from python to
excel and I need 1440 columns for that.
--
http://mail.python.org/mailman/listinfo/python-list
But isn't t_amb a list? I thought that the first piece of script would create a
list.
I'm trying to create a list named t_amb with some values that are in a Excel
sheet. And then I need to export that list to another Excel sheet
--
http://mail.python.org/mailman/listinfo/python-list
Hi!!
I keep having this error and I don't know why: TypeError: 'float' object is not
iterable.
I have this piece of code, that imports to python some data from Excel and
saves it in a list:
"
t_amb = []
for i in range(sh2.nrows):
t_amb.append(sh2.cell(i,2).value)
print t_amb
"
Here is e
Yes, I simplified it a lot.
I need to run it 24 times. What I don't really understand is how to put the
final temperature (result) in it = 0 in temp_-1 in it =1
--
http://mail.python.org/mailman/listinfo/python-list
Hello!
I have to make a script that calculates temperature, but one of the
parameters is the temperature in the iteration before, for example:
temp = (temp_-1)+1
it = 0
temp = 3
it = 1
temp = 3+1
it = 2
temp = 4+1
How can I do this in a simple way?
Thanks a lot!
--
http://mail.python.org/mai
Thank you so much!!! It works perfectly!!!
;)
--
http://mail.python.org/mailman/listinfo/python-list
23 matches
Mail list logo