map-like function on dict values?
Huaiyu Zhu
huaiyu at gauss.almadan.ibm.com
Wed Feb 27 20:04:50 EST 2002
More information about the Python-list mailing list
Wed Feb 27 20:04:50 EST 2002
- Previous message (by thread): map-like function on dict values?
- Next message (by thread): map-like function on dict values?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Is there a way to do this
for k, v in dict.items():
dict[k] = f(v)
without involving a Python for loop? I'd imagine that a function
implemented in C could speed things up quite a bit. Something like
either of the following
mapvalue(f, dict)
dict.mapvalue(f)
Huaiyu
- Previous message (by thread): map-like function on dict values?
- Next message (by thread): map-like function on dict values?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list