Hi,
could you actually help me further?
I thought it will quite easy but I've been programming in python just
for a month.
I need to add extra items in new list.
So here is example:
I have a list of dictionaries.
e.g.
[{'index': 0, 'ip_addr': '1.2.3.4', 'server-name':'Asterisk', 'transport':
'ud
Thank you to all of you guys.
It's exactly I was looking for.
Lada
Bart Ogryczak wrote:
> On 12 jul, 04:49, anethema <[EMAIL PROTECTED]> wrote:
>
>>> li = [ {'index': 0, 'transport': 'udp', 'service_domain':
>>> 'dp0.example.com'},
>>> {'index': 1, 'transport': 'udp', 'service_domain
Thank you to all of you guys.
It's exactly I was looking for.
> You provide scant information for this task. For example, is the
> new list ordered or unordered? Can the list corresponding to the
> 'transports' key contain duplicates?
>
unordered is fine.. I will be storing it in DB from that
On 12 jul, 04:49, anethema <[EMAIL PROTECTED]> wrote:
> > li = [ {'index': 0, 'transport': 'udp', 'service_domain':
> > 'dp0.example.com'},
> > {'index': 1, 'transport': 'udp', 'service_domain':
> > 'dp1.example.com'},
> > {'index': 0, 'transport': 'tcp', 'service_domain':
> > 'dp0
On 11 jul, 21:08, Ladislav Andel <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a list of dictionaries.
> e.g.
> [{'index': 0, 'transport': 'udp', 'service_domain': 'dp0.example.com'},
> {'index': 1, 'transport': 'udp', 'service_domain': 'dp1.example.com'},
> {'index': 0, 'transport': 'tcp', 'service_do
> li = [ {'index': 0, 'transport': 'udp', 'service_domain':
> 'dp0.example.com'},
> {'index': 1, 'transport': 'udp', 'service_domain':
> 'dp1.example.com'},
> {'index': 0, 'transport': 'tcp', 'service_domain':
> 'dp0.example.com'},
> {'index': 1, 'transport': 'tcp', 'servi
On Jul 11, 12:08 pm, Ladislav Andel <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a list of dictionaries.
> e.g.
> [{'index': 0, 'transport': 'udp', 'service_domain': 'dp0.example.com'},
> {'index': 1, 'transport': 'udp', 'service_domain': 'dp1.example.com'},
> {'index': 0, 'transport': 'tcp', 'service
Hi,
I have a list of dictionaries.
e.g.
[{'index': 0, 'transport': 'udp', 'service_domain': 'dp0.example.com'},
{'index': 1, 'transport': 'udp', 'service_domain': 'dp1.example.com'},
{'index': 0, 'transport': 'tcp', 'service_domain': 'dp0.example.com'},
{'index': 1, 'transport': 'tcp', 'service_dom
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> what are the time complexities of inserting / removing / checking if an
> element is present in 1) a list and 2) a dictionary?
> does anybody know?
I assume in the list case, the element you want to operate on is in
the middle of the list. In CPyt
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> what are the time complexities of inserting / removing / checking if an
> element is present in 1) a list and 2) a dictionary?
Partly dependent on the implementation, of which there are several for
Python (CPython, Jython, PyPy, and others). Which
On Wed, 29 Mar 2006 09:38:05 -0800, [EMAIL PROTECTED] wrote:
>
> hi,
> i've just a simple question:
> what are the time complexities of inserting / removing / checking if an
> element is present in 1) a list and 2) a dictionary?
> does anybody know?
> thanks
No no no, that's not the way to ask t
Hi
Use the "timeit" module, like so:
>>> from timeit import Timer
>>> t = Timer('[i for i in range(1)]') # The string is code to execute
>>> (for timing)
>>> print t.timeit(100) # execute it 100 times and print the result
0.222389936447
I would appreciate it if you could present your resul
hi,
i've just a simple question:
what are the time complexities of inserting / removing / checking if an
element is present in 1) a list and 2) a dictionary?
does anybody know?
thanks
--
http://mail.python.org/mailman/listinfo/python-list
13 matches
Mail list logo