Python for Windows

2020-10-14 Thread Ana María Pliego San Martín
Hi!

I've tried to install Python a couple of times on my computer. Although it
works fine when first downloaded, every time I turn off my computer and
then back on Python says it has a problem that needs fixing. After "fixing"
it, I still encounter some issues and have the need to uninstall it and
install it again. Do you know what the problem is?

Thank you.

Ana

-- 
*POLÍTICA DE 
PRIVACIDAD: Las instituciones pertenecientes al Sistema 
UP-IPADE 
utilizarán cualquier dato personal expuesto en el presente correo 

electrónico, única y exclusivamente para cuestiones académicas, 
administrativas, de comunicación, o bien para las finalidades expresadas
 
en cada asunto en concreto, esto en cumplimiento con la Ley Federal de 
Protección de Datos Personales en Posesión de los Particulares. Para 
mayor 
información acerca del tratamiento y de los derechos que puede 
hacer 
valer, usted puede acceder al aviso de privacidad integral a 
través de 
nuestras páginas de Internet: www.up.edu.mx <http://www.up.edu.mx> / 
prepaup.up.edu.mx <http://prepaup.up.edu.mx> / www.ipade.mx 
<http://www.ipade.mx> / www.ipadealumni.com.mx 
<http://www.ipadealumni.com.mx> 
La información contenida en este correo es 
privada y confidencial, dirigida exclusivamente a su destinatario. Si usted 
no es el destinatario del mismo debe destruirlo y notificar al remitente 
absteniéndose de obtener copias, ni difundirlo por ningún sistema, ya que 
está prohibido y goza de la protección legal de las comunicaciones.*

-- 
https://mail.python.org/mailman/listinfo/python-list


Python and GIL

2013-05-30 Thread Ana Marija Sokovic
Hi,

Can somebody explain to me how would you proceed in releasing the GIL and
whether you think it will have consequences?

Thanks
Ana

-- 
http://mail.python.org/mailman/listinfo/python-list


Pulp problem _dummy

2013-05-23 Thread Ana Dionísio
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 Termo0 <= 0

_C7: 0.0686928673545 F0 >= 0

_C8: 0.0686928673545 F0 <= 0

_C9: 2 T1 >= 0

_C10: 2 T1 <= 0

_C11: 0.0686928673545 Frigorifico1 >= 0

_C12: 0.0686928673545 Frigorifico1 <= 0

_C13: 2 Termo0 >= 0

_C14: 2 Termo0 <= 0

_C15: 0.0686928673545 F0 >= 0

_C16: 0.0686928673545 F0 <= 0

_C17: - AC0 - VE0 - 2 T0 - 0.0686928673545 F0 - AC1 - VE1
 - 2 T1 - 0.0686928673545 F1 >= -15

VARIABLES
AC0 <= 2.75 Continuous
VE0 = 0 Continuous
0 <= T0 <= 1 Integer
0 <= F0 <= 1 Integer
AC1 <= 2.75 Continuous
VE1 = 0 Continuous
0 <= T1 <= 1 Integer
0 <= F1 <= 1 Integer
__dummy = 0 Continuous

I don't know if this is enough information for you but if you couold help me I 
would be very very grateful

Thank you!
-- 
http://mail.python.org/mailman/listinfo/python-list


Sum operation in numpy arrays

2013-05-02 Thread Ana Dionísio
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 'numpy.string_'"

How can I sum my arrays?
-- 
http://mail.python.org/mailman/listinfo/python-list


Scan CSV file and saving it into an array

2013-04-24 Thread Ana Dionísio
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 get an error.


p = csv.reader(open('file.csv'), delimiter=';')
a=[0]*2881
a = numpy.array(a, dtype=dict)
for row in p:
   if row[0]=="200":
  a=row
  break
print a
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reading a CSV file

2013-04-23 Thread Ana Dionísio
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


Re: Reading a CSV file

2013-04-23 Thread Ana Dionísio
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


Reading a CSV file

2013-04-23 Thread Ana Dionísio
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."

Thank you!
-- 
http://mail.python.org/mailman/listinfo/python-list


Lists and arrays

2013-04-22 Thread Ana Dionísio
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 operand type(s) for +: 'numpy.ndarray' and 
'numpy.ndarray'"

Can you help me?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: CSV to matrix array

2013-04-13 Thread Ana Dionísio
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


Re: CSV to matrix array

2013-04-12 Thread Ana Dionísio
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/listinfo/python-list


Re: CSV to matrix array

2013-04-12 Thread Ana Dionísio
Hi, thanks for yor answer! ;)

Anyone has more suggestions?
-- 
http://mail.python.org/mailman/listinfo/python-list


CSV to matrix array

2013-04-12 Thread Ana Dionísio
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('Cenarios.csv','r')
cenario = csv.reader(input)

array=numpy.zeros([20, 12])


I know I have to use for loops but I don't know how to use it to put the data 
the way I want. Can you help me?

Thanks!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to do this?

2013-04-01 Thread Ana Dionísio
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


How to do this?

2013-04-01 Thread Ana Dionísio
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 in the next 3, 
for example the following output:

[0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0]

Do you have any suggestions?


I'm sorry if I can't explain this in a better way, English is not my first 
language

Thank you
-- 
http://mail.python.org/mailman/listinfo/python-list


Export data from python to a txt file

2013-03-29 Thread Ana Dionísio
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 xrange(len(a)):
LDFile.write("\t")
LDFile.write(str(a[i]))
LDFile.write("\t")
LDFile.write(str(b[i]))

 f.close()"

But it doesn't have the format I want. Can you help?

Thanks!

 
-- 
http://mail.python.org/mailman/listinfo/python-list


Test a list

2013-03-20 Thread Ana Dionísio

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://mail.python.org/mailman/listinfo/python-list


Lists and Decimal numbers

2013-03-20 Thread Ana Dionísio
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 define the number of decimal numbers I want to print in this case? 
For example with 4 decimal numbers, it would print:

0.
0.0167
0.0333
...

Can you help?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Excel column 256 limit

2013-03-18 Thread Ana Dionísio
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


Excel column 256 limit

2013-03-18 Thread Ana Dionísio
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


Re: TypeError: 'float' object is not iterable

2013-03-14 Thread Ana Dionísio
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


TypeError: 'float' object is not iterable

2013-03-14 Thread Ana Dionísio
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 everything ok.

But then, I need to pass the data again to exel, so I wrote this:

"
a=8
for b in range (len(t_amb)):
a=8
for d in t_amb[b]:
a=a+1
sheet.write(a,b+1,d)
"

The error appear in "for d in t_amb[b]:" and I don't understand why. Can you 
help me?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recursive function

2013-03-05 Thread Ana Dionísio
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


Recursive function

2013-03-05 Thread Ana Dionísio
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/mailman/listinfo/python-list


Re: Data Tree urgent help!!!!!!

2013-02-19 Thread Ana Dionísio
Thank you so much!!! It works perfectly!!!

;)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: why generator assigned to slice?

2011-01-06 Thread ana sanchez
In  Peter Otten <__pete...@web.de> writes:

>ana sanchez wrote:

>> i found this when i read the source of a program in python:
>> 
>> self.__chunks[start:end] = (chunk for i in xrange(start, end))

>> what utility has to assign a generator to a slice???  ?the *final
>> result* isn't the same as this?:
>> 
>> self.__chunks[start:end] = [chunk for i in xrange(start, end)]

>Whoever used the first variant probably was hoping that it was either faster 
>or used less peak memory. I think the latter is wrong, and the former can 
>easily be checked:

>$ python -m timeit -s'chunk = "yadda"; chunks = range(100); start = 20; end 
>= 50' 'chunks[start:end] = (chunk for i in xrange(start, end))'
>10 loops, best of 3: 9.02 usec per loop

>$ python -m timeit -s'chunk = "yadda"; chunks = range(100); start = 20; end 
>= 50' 'chunks[start:end] = [chunk for i in xrange(start, end)]'
>10 loops, best of 3: 4.16 usec per loop

>$ python -m timeit -s'chunk = "yadda"; chunks = range(100); start = 20; end 
>= 50' 'chunks[start:end] = [chunk]*(end-start)'
>100 loops, best of 3: 1.02 usec per loop


peter thank you very much!!!  (i like very much the timing "miniscripts")

ana

-- 
http://mail.python.org/mailman/listinfo/python-list


why generator assigned to slice?

2011-01-05 Thread ana sanchez





hi!!!

i found this when i read the source of a program in python:

self.__chunks[start:end] = (chunk for i in xrange(start, end))

and also this:

self.__lines[line:line] = (None for i in xrange(count))

what utility has to assign a generator to a slice???  ?the *final
result* isn't the same as this?:

self.__chunks[start:end] = [chunk for i in xrange(start, end)]

self.__chunks[line:line] = [None for i in xrange(count)]

thanks!!!

ana

p.d. excuse my english
-- 
http://mail.python.org/mailman/listinfo/python-list


►►►Get FREE Satellite TV on your PC ◄◄◄

2007-08-03 Thread Ana James
Watch Satellite TV On Your Computer Without Paying Monthly Fees... FOR
FREE?

Watch all your favorite shows on your Computer from anywhere in the
World!

Save 1000's of $$$ over many years on cable and satellite bills.

INSTANT DOWNLOAD

Plus Free Unlimited Downloads Movies, MP3s Music, etc !!!

More Details: http://tvonpc.us.to/

-- 
http://mail.python.org/mailman/listinfo/python-list


◘►FREE Satellite TV on your PC◄◘

2007-07-28 Thread Ana James
Watch all your favorite shows on your Computer from anywhere in the
World!

Save 1000's of $$$ over many years on cable and satellite bills.

INSTANT DOWNLOAD

For More Details: http://tvonpc.cq.bz

-- 
http://mail.python.org/mailman/listinfo/python-list


►►YOUR VALUABLE OPINION COULD EARN YOU $3000 ◄◄

2007-07-21 Thread Ana Clark
Do You Know Your VALUABLE OPINION Can Earn You Upto $3000 Per Month

>> Get Paid to Try New Products, Drive Car, Travel etc...

Know more about these Opportunities, Just follow the link:

http://shortlinks.co.uk/35x

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: urgent - Matplolib with IDLE!

2007-03-19 Thread Ana Paula Leite

Hi,

in site-packages/matplotlib/backends/backend_tkagg.py
I commented out in the show function the line

Tk.mainloop()

In addition to the changes I mentioned in my first email, this has solved my
problem!









On 3/19/07, Rob Clewley <[EMAIL PROTECTED]> wrote:


I have the same problem with a similar setup (except Python 2.4.3) and
have tried the same solutions (BTW those steps really did used to work
on my machine using Python 2.3.5). In the short term you could either
try IPython (a proper solution to this problem, which returns me to
the prompt just fine after closing the figure) or try the following
"quick and dirty fix" with IDLE:

1) If your script does stuff other than define classes and functions,
put in a command that prevents it getting to the calculations (e.g.
insert a "1/0" line) or, for instance, turn all your calculations into
function calls that you can easily comment out (temporarily). Run your
script using F5 so that you just get the prompt.
3) Create an empty figure using pylab.figure() or whatever.
2) Close the figure and the IDLE console (command prompt window) that
opened when you ran the script (you have to say Yes when it asks about
killing a python process).
3) This leaves an orphaned python process which you have to clean up
later using your Task Manager, but ...
4) you can now continue to interact with any new IDLE console created
in the current session when you bring up new figures. i.e. uncomment
the parts of your script that actually do stuff and run it again.

At least that's a quick fix that's working for me while I await a
better answer too... Perhaps this hack will outrage someone's
sensibilities sufficiently that we'll hear of a better IDLE solution.

HTH,
Rob

-- 
http://mail.python.org/mailman/listinfo/python-list

urgent - Matplolib with IDLE!

2007-03-19 Thread Ana Paula Leite

Dear all,

I've just started using Matplotlib and I'm trying to make it work in IDLE.

Other people have reported the same problem as I'll refer, but I've tried
some solutions that I found in the web and I haven't succeded. Every time I
produce a figure, I can't get the IDLE prompt active again after closing
that figure.

I've tried the following:

- in site-pachages/matplotlib/backends/backend_tkagg.py I've uncommented the
line #os.environ['PYTHONINSPECT'] = '1'

- I've changed to the interactive mode, i.e I've set interactive=True in
share/matplotlib/.matplotlibrc

- I've started IDLE with the -n flag

I would sincerely appreciate your help, because I must finish some work very
very soon and I'm going crazy with this issue...
By the way, I'm using
- windows XP
- matplotlib-0.90.0.win32-py2.5
- numpy-1.0.1.win32-py2.5
- python 2.5

Te
-- 
http://mail.python.org/mailman/listinfo/python-list