Re: [Tutor] Help needed

2014-04-26 Thread C Smith
As others have pointed out, a mapping/dictionary or just a list of lists seems like how you would want to organize the data for input. I think your problem is insistence on using sets. I am no Python guru, but I think this list is more for exploratory learning of Python. I think people are trying t

Re: [Tutor] Help needed

2014-04-26 Thread Suhana Vidyarthi
Thanks for the response Smith, I was thinking make be I have done something incorrect and if there is some other function that can be used to display the output in desired order but don't see it possible thats why was wondering if any of you Python gurus have any inputs for me :-) On Sat, Apr 26

Re: [Tutor] Help needed

2014-04-26 Thread C Smith
err, set also is unordered. I can see you are using set for a reason, but has no concept of order. On Sat, Apr 26, 2014 at 3:20 PM, C Smith wrote: > Just glancing at your work, I see you have curly braces around what looks > like it should be a list. If you are concerned with the order of your >

Re: [Tutor] Help needed

2014-04-26 Thread C Smith
Just glancing at your work, I see you have curly braces around what looks like it should be a list. If you are concerned with the order of your output, dictionaries do not have a concept of order. On Sat, Apr 26, 2014 at 3:16 PM, Suhana Vidyarthi wrote: > Hi Danny, > > Let me give you a high le

Re: [Tutor] Help needed

2014-04-26 Thread Suhana Vidyarthi
Hi Danny, Let me give you a high level brief of what I am doing: I am working on doing "disaster aware routing" considering the 24-node US network where I will be setting up connection between two any two nodes (I will select the source and destination nodes randomly). Also I have some links whose

Re: [Tutor] Help needed

2014-04-26 Thread Danny Yoo
>>> I want to create two arrays using the above file (Links array and Prob >>> array) that should give following output: >>> >>> *Links *= { [3,5] [5,4] [5,8] [7,8] [14,10] [14,13] [17,13] [14,18] >>> [10,13] [14,13] [17,13] [12,13] [11,6] [11,9][11,12] [11,19] [19,20] >>> [15,20] [21,20] [20,21] [

Re: [Tutor] Help needed

2014-04-26 Thread Suhana Vidyarthi
Thanks for the response Alan. my clarifications are below: On Sat, Apr 26, 2014 at 1:41 AM, Alan Gauld wrote: > On 26/04/14 01:46, Suhana Vidyarthi wrote: > > I have this file: >> >> 1,3,5,0.03 >> >> 2,3,5,5,4,0.11 >> >> 3,3,5,5,4,5,8,0.04 >> > > >> And each line is interpreted as: >> >>

Re: [Tutor] Help needed

2014-04-26 Thread Suhana Vidyarthi
Hi, The reason I opened a link is because there are changes in the code. Does it make sense? Else I can definitely go back to the thread. On Sat, Apr 26, 2014 at 9:05 AM, Danny Yoo wrote: > Hi Suhana, > > Also note that you asked this question just a few days ago. > > https://mail.pytho

Re: [Tutor] trying to understand pattern matching code

2014-04-26 Thread rahmad akbar
hi Alan, your explanation clears most things, super thanks!! On Sat, Apr 26, 2014 at 10:58 AM, Alan Gauld wrote: > On 26/04/14 09:36, rahmad akbar wrote: > >> but i still couldnt get this line though >> >> D = (( D << 1) + 1) & masks [ c ] > > > Do you understand the concept of bit shifting? >

Re: [Tutor] Help needed

2014-04-26 Thread Danny Yoo
Hi Suhana, Also note that you asked this question just a few days ago. https://mail.python.org/pipermail/tutor/2014-April/101019.html We're not robots. We don't like repetition unless there's a reason for it, and in this case, you got responses to the earlier question. For example: htt

Re: [Tutor] xlrd package

2014-04-26 Thread Mark Lawrence
On 26/04/2014 05:48, Sunil Tech wrote: Hi, I want to know how many sheets can be created in Excel using xlrd package. Thank you By using your favourite search engine you could have found this http://www.python-excel.org/ and hence this https://groups.google.com/forum/#!forum/python-excel

Re: [Tutor] xlrd package

2014-04-26 Thread Karim
On 26/04/2014 10:43, Alan Gauld wrote: On 26/04/14 05:48, Sunil Tech wrote: I want to know how many sheets can be created in Excel using xlrd package. This list if for people learning the Python language and standard library. xlrd is not part of that so you may have more success asking on

Re: [Tutor] trying to understand pattern matching code

2014-04-26 Thread Alan Gauld
On 26/04/14 09:36, rahmad akbar wrote: but i still couldnt get this line though D = (( D << 1) + 1) & masks [ c ] Do you understand the concept of bit shifting? ie 000110 shifted left gives 001100 and 000110 shifted right gives 11 In other words the bit pattern moves left or right and

Re: [Tutor] xlrd package

2014-04-26 Thread Alan Gauld
On 26/04/14 05:48, Sunil Tech wrote: I want to know how many sheets can be created in Excel using xlrd package. This list if for people learning the Python language and standard library. xlrd is not part of that so you may have more success asking on an xlrd forum. Or failing that a Windo

Re: [Tutor] Help needed

2014-04-26 Thread Alan Gauld
On 26/04/14 01:46, Suhana Vidyarthi wrote: I have this file: 1,3,5,0.03 2,3,5,5,4,0.11 3,3,5,5,4,5,8,0.04 And each line is interpreted as: * 1,3,5,0.03-> This line means 1 link can be down i.e. between 3—5 with a probability of failure *0.03* * 2,3,5,5,4,0.11 -> This line mean

Re: [Tutor] trying to understand pattern matching code

2014-04-26 Thread rahmad akbar
Danny and Dave, super thanks on the plain text advice. i'm sending this mail on plain text, please let me know if it turned out to be otherwise back to the problem just googled binary and i now have some idea on it. i now understand turning on 16 and 8 gives 24 and thus 4+8 = 12. why is this? i no