On Dec 10, 1:28 pm, [EMAIL PROTECTED] wrote:
> Seongsu Lee:
>
> >I have a dictionary with million keys. Each value in the dictionary has a
> >list with up to thousand integers.<
>
> Let's say each integer can be represented with 32 bits (if there are
> less numbers then a 3-byte representation may
Seongsu Lee:
>I have a dictionary with million keys. Each value in the dictionary has a list
>with up to thousand integers.<
Let's say each integer can be represented with 32 bits (if there are
less numbers then a 3-byte representation may suffice, but this makes
things more complex), that is 2^2
On Dec 10, 9:45 am, MonkeeSage <[EMAIL PROTECTED]> wrote:
> On Dec 10, 8:31 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 2007-12-10, MonkeeSage <[EMAIL PROTECTED]> wrote:
>
> > > If I'm not mistaken, building a reverse dictionary like that will be
> > > O(n*m) because dict/list access i
On Dec 10, 8:31 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-12-10, MonkeeSage <[EMAIL PROTECTED]> wrote:
>
> > If I'm not mistaken, building a reverse dictionary like that will be
> > O(n*m) because dict/list access is O(n) (ammortized). Somebody correct
> > me if I'm wrong. In that case,
On Dec 10, 8:31 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-12-10, MonkeeSage <[EMAIL PROTECTED]> wrote:
>
> > If I'm not mistaken, building a reverse dictionary like that will be
> > O(n*m) because dict/list access is O(n) (ammortized). Somebody correct
> > me if I'm wrong. In that case,
On 2007-12-10, MonkeeSage <[EMAIL PROTECTED]> wrote:
> If I'm not mistaken, building a reverse dictionary like that will be
> O(n*m) because dict/list access is O(n) (ammortized). Somebody correct
> me if I'm wrong. In that case, it really depends on how you will use
> the dict to see whether you g
On Dec 10, 3:50 am, Seongsu Lee <[EMAIL PROTECTED]> wrote:
> On 12월10일, 오후12시18분, Adonis Vargas <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Seongsu Lee wrote:
> > > Hi,
>
> > > I have a dictionary with million keys. Each value in the
> > > dictionary has a list with up to thousand integers.
> > > Follow
On 12월10일, 오후12시18분, Adonis Vargas <[EMAIL PROTECTED]>
wrote:
> Seongsu Lee wrote:
> > Hi,
>
> > I have a dictionary with million keys. Each value in the
> > dictionary has a list with up to thousand integers.
> > Follow is a simple example with 5 keys.
>
> > dict = {1: [1, 2, 3, 4, 5],
> >2: [
Adonis Vargas:
> Also, you should never use reserved words like 'dict' this creates
> confusion and can cause Python to misbehave since you are rebinding the
> name.
> Adonis Vargas
After hearing this suggestion for the 300th time, I think it may be
the moment to fix this problem in Python3, and m
Seongsu Lee wrote:
> Hi,
>
> I have a dictionary with million keys. Each value in the
> dictionary has a list with up to thousand integers.
> Follow is a simple example with 5 keys.
>
> dict = {1: [1, 2, 3, 4, 5],
>2: [10, 11, 12],
>90: [100, 101, 102, 103, 104, 105],
>91: [20
Seongsu Lee <[EMAIL PROTECTED]> wrote:
> The reason I use the dict for my data is to speed up the search by key.
Ok, I understand that once the overhead of creating the dict has been done,
getting access to values within it is quick. And taking the time to create
a set of reverse keys speeds up
On 12월10일, 오전6시49분, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote:
> Seongsu Lee <[EMAIL PROTECTED]> wrote:
> > Hi,
>
> > I have a dictionary with million keys. Each value in the
> > dictionary has a list with up to thousand integers.
> > Follow is a simple example with 5 keys.
>
> > dict = {1: [1, 2
> I have a dictionary with million keys. Each value in the
> dictionary has a list with up to thousand integers.
> Follow is a simple example with 5 keys.
>
> dict = {1: [1, 2, 3, 4, 5],
>2: [10, 11, 12],
>90: [100, 101, 102, 103, 104, 105],
>91: [20, 21, 22],
>99: [15,
[EMAIL PROTECTED] wrote:
> Jeremy C B Nicoll:
> > The code someone else posted ...
>
> If you are talking about my D code then I know it...
No I meant the code that used python to iterate over the dict and create
zillions of extra keys. I've deleted earlier posts in the thread and wasn't
sure w
Jeremy C B Nicoll:
> The code someone else posted to reverse the keys is all very well, but
> surely hugely wasteful on cpu, maybe storage, and elapsed time.
If you are talking about my D code then I know it, the creation of the
first dict has to be skipped, if possible... The code I have posted
m
Seongsu Lee <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a dictionary with million keys. Each value in the
> dictionary has a list with up to thousand integers.
> Follow is a simple example with 5 keys.
>
> dict = {1: [1, 2, 3, 4, 5],
>2: [10, 11, 12],
>90: [100, 101, 102, 103, 104, 1
Seongsu Lee:
> What do you think of this? Ideas with less space complexity?
You can put the second group of keys in a second dictionary, so you
don't have to mangle them, and it may be a bit faster.
Regarding the space complexity, I don't know how you can reduce it
with Python. Probably you can c
Seongsu Lee a écrit :
> Hi,
>
> I have a dictionary with million keys. Each value in the
> dictionary has a list with up to thousand integers.
> Follow is a simple example with 5 keys.
>
> dict = {1: [1, 2, 3, 4, 5],
>2: [10, 11, 12],
>90: [100, 101, 102, 103, 104, 105],
>91:
On 12월10일, 오전1시53분, Pablo Ziliani <[EMAIL PROTECTED]> wrote:
> Seongsu Lee escribió:
>
> > Hi,
>
> > I have a dictionary with million keys. Each value in the
> > dictionary has a list with up to thousand integers.
> > (...)
>
> > I want to find out the key value which has a specific
> > integer in
On 12월10일, 오전1시23분, Seongsu Lee <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a dictionary with million keys. Each value in the
> dictionary has a list with up to thousand integers.
> Follow is a simple example with 5 keys.
>
> dict = {1: [1, 2, 3, 4, 5],
>2: [10, 11, 12],
>90: [100, 101,
Seongsu Lee escribió:
> Hi,
>
> I have a dictionary with million keys. Each value in the
> dictionary has a list with up to thousand integers.
> (...)
>
> I want to find out the key value which has a specific
> integer in the list of its value.
Sorry if this is unhelpful, but have you considered m
Hi,
I have a dictionary with million keys. Each value in the
dictionary has a list with up to thousand integers.
Follow is a simple example with 5 keys.
dict = {1: [1, 2, 3, 4, 5],
2: [10, 11, 12],
90: [100, 101, 102, 103, 104, 105],
91: [20, 21, 22],
99: [15, 16, 17, 18,
22 matches
Mail list logo