larry-discuss team mailing list archive
-
larry-discuss team
-
Mailing list archive
-
Message #00085
Re: A new proposal for indexing with labels
Here's a first pass at lix:
>> idx = lix(['a', 'b'])
>> label = ['a', 'b', 'c']
>> idx.index(label)
[0, 1]
class lix(object):
def __init__(self, label):
if type(label) != list:
raise TypeError, 'label must be a list'
self.label = label
def index(self, label):
return map(label.index, self.label)
def __repr__(self):
return 'larry label index object: \n' + str(self.label)
References
-
A new proposal for indexing with labels
From: Keith Goodman, 2010-02-07
-
Re: A new proposal for indexing with labels
From: Keith Goodman, 2010-02-08
-
Re: A new proposal for indexing with labels
From: Keith Goodman, 2010-02-08
-
Re: A new proposal for indexing with labels
From: Keith Goodman, 2010-02-08
-
Re: A new proposal for indexing with labels
From: josef . pktd, 2010-02-08
-
Re: A new proposal for indexing with labels
From: Keith Goodman, 2010-02-08
-
Re: A new proposal for indexing with labels
From: josef . pktd, 2010-02-08
-
Re: A new proposal for indexing with labels
From: Keith Goodman, 2010-02-08
-
Re: A new proposal for indexing with labels
From: josef . pktd, 2010-02-08
-
Re: A new proposal for indexing with labels
From: Keith Goodman, 2010-02-08