> Oh, and here's the error my program returns when it runs:
>
> Traceback (most recent call last):
> File "/home/jacob/Dropbox/Shared_With_Chris_And_Logan/Jake's
> Programs/Yet_To_Work_On/Synaptic/synaptic.py", line 57, in
> neuron.smartest()
> File "/home/jacob/Dropbox/Shared_With_Chris_
Oh, and here's the error my program returns when it runs:
Traceback (most recent call last):
File "/home/jacob/Dropbox/Shared_With_Chris_And_Logan/Jake's
Programs/Yet_To_Work_On/Synaptic/synaptic.py", line 57, in
neuron.smartest()
File "/home/jacob/Dropbox/Shared_With_Chris_And_Logan/Jake
ranjan das wrote:
This is a small example i created
from operator import itemgetter
temp={'4':(2,3), '2':(5,8)}
print temp.items()
new_temp=sorted(temp.items(), key=itemgetter(1)
print new_temp
Another syntax error. Please ensure that you test your code before
posting. In this case, it's eas
This is a small example i created
from operator import itemgetter
temp={'4':(2,3), '2':(5,8)}
print temp.items()
new_temp=sorted(temp.items(), key=itemgetter(1)
print new_temp
I want to sort the dictionary by the value in the first element of the tuple
((2,3) and (5,8)) and then the second
On Mon, 08 Dec 2008 08:55:40 -0800, Lawrence Wickline wrote:
> On Dec 6, 2008, at 12:41 AM, Lie Ryan wrote:
>>
>> In most cases, in processing involving networking, the bottleneck is
>> the
>> network speed itself. To speed things up by optimizing your own code
>> might not make your download sign
On Dec 6, 2008, at 12:41 AM, Lie Ryan wrote:
In most cases, in processing involving networking, the bottleneck is
the
network speed itself. To speed things up by optimizing your own code
might not make your download significantly faster (getting 60 seconds
faster is great for scripts that us
On Thu, 04 Dec 2008 10:48:54 -0800, Lawrence Wickline wrote:
> Thanks for the help I think I got it.
>
> As far as lines go I believe it will be processing hundreds of thousands
> of lines if not a million or more lines per run. I haven't gotten to do
> a full run but it has been running acceptab
Thanks for the help I think I got it.
As far as lines go I believe it will be processing hundreds of
thousands of lines if not a million or more lines per run. I haven't
gotten to do a full run but it has been running acceptably fast on my
test files.
I ended up putting it into a main fun
On Wed, Dec 3, 2008 at 7:58 PM, Lawrence Wickline
<[EMAIL PROTECTED]> wrote:
> how would I sort on bytes sent?
You can't actually sort a dictionary; what you can do is sort the list of items.
In this case each item will look be a tuple
(filename, (bytes, bytes_sent))
and dict.items() will be a
I am working on a reducer that needs to produce a sorted output of files
sorted on their overall bandwidth use. I create a dictionary with the file
name as the key (it is always unique) and in the values I am populating a
list with the two values of bytes and bytes sent.
Each entry looks like {fi
Hi JOhan,
> You see, I didn't put all the keys and values in the dicionary manually.
> It was generated while parsing a file with some Python code, that's why
> the dict is not in order.
It wouldn't have mattered if you had done it manually. The order of
a dictionary is calculated by Python dynam
Johan Geldenhuys wrote:
> Thanks, Danny.
>
> You see, I didn't put all the keys and values in the dicionary manually.
> It was generated while parsing a file with some Python code, that's why
> the dict is not in order. I just want to do it to read easier and look
> something up.
You want the
Thanks, Danny.
You see, I didn't put all the keys and values in the dicionary
manually. It was generated while parsing a file with some Python code,
that's why the dict is not in order. I just want to do it to read
easier and look something up.
How will I then put my dict together again after
Hallo,
you can also sort based on the values:
>>> list_of_nums = nums.items()>>> list_of_nums.sort(lambda x,y: cmp(x[1],y[1]))
Cheers,
pujo
On 11/4/05, Danny Yoo <[EMAIL PROTECTED]> wrote:
On Fri, 4 Nov 2005, Johan Geldenhuys wrote:> In my new project I needed a dictionary with TCP/UDP p
> ser_port = {'4401': 'ds-srvr', \
> '5427': 'sco-peer-tta', \
> '4446': 'n1-fwp', \
> '3734': 'synel-data', \
> '4447': 'n1-rmgmt', \
> '5745': 'fcopy-server', \
> '5990': 'wbem-exp-https', \
> '4026': 'as-debug', \
> '3724': 'battlenet'}
Hi Johan,
Just as a quick side note: all those
On Fri, 4 Nov 2005, Johan Geldenhuys wrote:
> In my new project I needed a dictionary with TCP/UDP port numbers as
> keys and the service for that key as the value. I got the info from the
> services file in Linux and compiled a dictionary as I needed.
>
> The only thing that I want to do is to
Hi all,
In my new project I needed a dictionary with TCP/UDP port numbers as
keys and the service for that key as the value.
I got the info from the services file in Linux and compiled a dictionary
as I needed.
The only thing that I want to do is to sort the dictionary from the
smallest key num
17 matches
Mail list logo