Re: [Tutor] asyncio or threading

2016-02-27 Thread Zachary Ware
My apologies for taking so long to reply here again, it's been a busy couple of weeks. On Mon, Feb 15, 2016 at 7:18 PM, Alan Gauld wrote: > On 15/02/16 21:08, Zachary Ware wrote: >> This is not all asyncio can do. Callbacks are only one way of using it, the >> other, more common method is to use

Re: [Tutor] How to calculate high value from multiple lines for each column

2016-02-27 Thread Alan Gauld
On 27/02/16 15:46, Fosiul Alam wrote: > a) Can I combile 2 forloop into one ? Yes of course. for key in values: print "svtm-%s ,%s" % (key, values[key][0]) print "iostat-%s ,%s" % (key, values[key][1]) > b) How can remove first value from for loop - step a ? >

Re: [Tutor] How to calculate high value from multiple lines for each column

2016-02-27 Thread Fosiul Alam
Hi Alan Thanks for the help.yes now i can see how it working, i am just stick in small things so this is what i have done , a) Can I combile 2 forloop into one ? b) How can remove first value from for loop - step a ? for key in values: print "svtm-%s ,%s" % (key, values[k

Re: [Tutor] Convert structured 1D array to 2D array

2016-02-27 Thread Ek Esawi
Thanks Peter. It works now. I am trying to be creative but i am still getting my way around pythony. EKE ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Convert structured 1D array to 2D array

2016-02-27 Thread Emile van Sebille
On 2/26/2016 7:26 PM, Ek Esawi wrote: The result i am looking for is a 2D array (matrix) instead of 1D array of tuples. That's when i read a file using genfromtxt, it generated a 1D array of n tuples (like the example shown below); each tuple has one row from the original file. The file contains

Re: [Tutor] Unable to get out of loop [RESOLVING]

2016-02-27 Thread Ken G.
On 02/26/2016 09:26 PM, Steven D'Aprano wrote: On Fri, Feb 26, 2016 at 08:30:19PM -0500, Ken G. wrote: side = "" while side != "0" or side != "1" or side != "2": That will only exit if side == "0", "1" and "2" **at the same time**. Clearly that is impossible, so the condition is always true, a

Re: [Tutor] Convert structured 1D array to 2D array

2016-02-27 Thread Peter Otten
Ek Esawi wrote: > The result i am looking for is a 2D array (matrix) instead of 1D array > of tuples. That's when i read a file using genfromtxt, it generated a 1D > array of n tuples (like the example shown below); each tuple has one row > from the original file. The file contains multiple data t

Re: [Tutor] Convert structured 1D array to 2D array

2016-02-27 Thread Ek Esawi
The result i am looking for is a 2D array (matrix) instead of 1D array of tuples. That's when i read a file using genfromtxt, it generated a 1D array of n tuples (like the example shown below); each tuple has one row from the original file. The file contains multiple data types and so i used genfro

Re: [Tutor] Convert structured 1D array to 2D array

2016-02-27 Thread Peter Otten
Peter Otten wrote: > Or try > > b = numpy.array(a, dtype=(object, object)) That won't work, I accidentally tested it on an already converted array :( ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.p

Re: [Tutor] Convert structured 1D array to 2D array

2016-02-27 Thread Peter Otten
Ek Esawi wrote: > Thanks for the input. I tried your idea but i did not work; l got 1D array > of tuples; the same as the original array. I think b/c genfromtxt creates > an array and so it's already an array object-if i understand it correctly. > Your idea works well for a list which i tested but